Skip to content

test: the relay receipt-bucket helper removes every day bucket and pins the branch path (UTC-midnight flake) #771

Closed

Description

@tps-flint

Follow-up from the #769 review (non-blocking, test-only).

removeReceiptBucket in packages/cli/test/relay-delivery-loss.test.ts works out the bucket from Date.now() when it runs, but the delivery that wrote the receipt used an earlier timestamp. A run that crosses UTC midnight between the two removes tomorrow's (nonexistent) bucket and leaves the written one. The next delivery then reuses it, so the fsync count the test pins shifts: a midnight flake. The guard also checks only the bucket's basename, not the rest of the path.

What the fix does:

  • The helper removes every YYYY-MM-DD directory under the branch's receipt directory, so the date at cleanup time no longer matters.
  • Before removing anything, it asserts that the branch directory ends in .relay-accepted/by-branch/remote.
  • A mutation that flattens the receipt path (receiptBucket returning an empty string) still fails the fsync-fault tests at that assertion.

Refs #768, #769.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions