Skip to content

tests: instrument flaky content-addressed early-cutoff test#1794

Draft
Mic92 wants to merge 2 commits into
NixOS:masterfrom
Mic92:flaky-early-cutoff-repro
Draft

tests: instrument flaky content-addressed early-cutoff test#1794
Mic92 wants to merge 2 commits into
NixOS:masterfrom
Mic92:flaky-early-cutoff-repro

Conversation

@Mic92

@Mic92 Mic92 commented Jun 16, 2026

Copy link
Copy Markdown
Member

content-addressed/early-cutoff.t fails intermittently in CI on the "One downstream build should be cached" assertion. The two downstream builds race to completion; when both finish before either is resolved, neither is marked cached.

This PR loops the scenario several times per run to make the race reproduce reliably in CI, and dumps per-build state (output paths, cache flags, timings) on failure.

Debugging aid to capture the race — not meant to merge as-is.

early-cutoff.t fails intermittently on 'One downstream build should be
cached': the two downstream builds race, and when both finish before either
is resolved, neither gets cached. Loop the scenario to reproduce the race in
CI and dump per-build state on failure.
@Mic92 Mic92 marked this pull request as draft June 16, 2026 18:11
Two builds that resolve to the same content-addressed derivation should build
it once; the other must be marked cached. The in-memory steps map dedups
concurrent resolutions, but its entries are weak and die once the first build
finishes. CA floating outputs have no statically-known path, so a later build
cannot detect the existing realisation and rebuilds it.

Cache each CA derivation's BuildOutput on step success and reuse it when a
build resolves to an already-built derivation.
@Mic92 Mic92 force-pushed the flaky-early-cutoff-repro branch from e4828c4 to e6ea967 Compare June 16, 2026 18:15
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