Skip to content

Stop package_delay_hides_then_reveals flaking on its 1-second delay - #638

Merged
schmitch merged 1 commit into
mainfrom
claude/604-package-delay-flake
Oct 28, 2026
Merged

schmitch merged 1 commit into
mainfrom
claude/604-package-delay-flake

Conversation

@schmitch

Copy link
Copy Markdown
Member

Fixes #604

What changed

package_delay_hides_then_reveals (crates/core/tests/proxy_read.rs) gave its proxy a 1-second package delay and expected both the listing and the direct download to fall inside it. On CI's test job, which runs test binaries side by side, that second could pass between the two calls (run 40574617151: direct download must 404 inside the delay window).

The test now:

  • gives the proxy a one-hour delay, so no runner is slow enough to leave the window between the two in-window calls;
  • ends the window by backdating the version's first_seen_at two hours instead of sleeping 1.1 s past it.

This is the deterministic form of the slack the issue asks for. The e2e test of the same name (crates/e2e/tests/proxy.rs) already works this way for the same reason, and the file's other delay tests backdate first_seen_at too. The test no longer reads the wall clock and no longer sleeps. The rest is unchanged: it still reuses the same ProxyRepo after the window, so the download that succeeds afterwards still shows the in-window 404 was not negatively cached in memory or in the database.

There is no changelog fragment because the change touches a test only and nobody running Forge would notice it (as with #486).

Checks

  • cargo test -p forge-core --test proxy_read: all 56 pass
  • cargo clippy -p forge-core --all-targets -- -D warnings: clean
  • cargo fmt --all -- --check: clean

Generated by Claude Code

The test gave its proxy a 1-second package delay and expected the
listing and the direct download to both fall inside it. On CI's `test`
job, which runs test binaries side by side, the second passed between
the two calls, and the download answered 200 where the test wanted 404
(#604).

The delay is now an hour, which no runner takes between two calls, and
the window elapses by backdating the version's `first_seen_at` two
hours instead of sleeping past it, as the e2e test of the same name
already does. The test no longer reads the wall clock and no longer
sleeps.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012e6DJaQwXDu83fu8xUmtAc
@schmitch
schmitch enabled auto-merge October 28, 2026 22:01
@schmitch
schmitch added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit c83a86e Oct 28, 2026
18 checks passed
@schmitch
schmitch deleted the claude/604-package-delay-flake branch October 28, 2026 22:17
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.

Flaky test: package_delay_hides_then_reveals fails on a loaded runner (1-second delay window)

2 participants