Skip to content

test(archive): stamp expiry fixtures with one fixed time - #697

Draft
loganj wants to merge 1 commit into
mainfrom
larry/archive-dedup-flake
Draft

loganj wants to merge 1 commit into
mainfrom
larry/archive-dedup-flake

Conversation

@loganj

@loganj loganj commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🤖

Summary

  • The Rust test that checks archive storage expiry (storage_partition_dedup_policy_paging_and_shrinking) failed intermittently in CI when a runner was slow. It did not show a product bug.
  • The test now gives all its fixture events one fixed timestamp, so it passes or fails the same way at any runner speed. The archive code is unchanged.

Details

  • Before: each fixture event took its timestamp from the wall clock when it was made, but the expiry check ran relative to the first event's time. With a 1-day retention window, prune(now + 86401) removes only rows stamped no more than 1 second after now. If the test's 205 inserts took more than about a second, the later rows survived. Then the assertion "expired observer rows are gone" (tests.rs:185) failed. This happened in CI run 37623102186, attempt 1, where the archive tests took about 2 s. It passed on rerun.
  • After: the test uses one timestamp for every event. The expiry boundary does not depend on how long the inserts take.
  • Reproduction: a 2.1 s delay inside the insert loop makes the old test fail with the same assertion at the same line. With this change, it passes with the delay too.
  • Other archive and relay tests that use these fixtures do not compare wall-clock stamps with a fixed time, so this is the only test changed.

storage_partition_dedup_policy_paging_and_shrinking stamped each
fixture event with the wall clock but pruned relative to the first
event's time. prune(now + 86401) with a 1-day window removes only rows
created at most 1 s after `now`. When the 205 ingests took over a
second, as on a loaded runner, later rows survived and the "expired
observer rows are gone" assertion at tests.rs:185 failed.

All fixtures in the test now share the first event's timestamp, so the
expiry boundary is exact regardless of runner speed. Production expiry
code is unchanged.

A 2.1 s delay inside the ingest loop reproduces the CI assertion on the
old test and passes with this change.

Signed-off-by: Larry <627498bd4bd1f281a16431e3c6cce3b5c25b6692798c78672298aefbf2f8f8b5@buzz.block.builderlab.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant