Do not share store between builder and queue runner in unit tests#1642
Merged
Ericson2314 merged 1 commit intoNixOS:masterfrom Apr 8, 2026
Merged
Do not share store between builder and queue runner in unit tests#1642Ericson2314 merged 1 commit intoNixOS:masterfrom
Ericson2314 merged 1 commit intoNixOS:masterfrom
Conversation
94b39c3 to
3e737bb
Compare
artemist
reviewed
Apr 7, 2026
2e43947 to
4bbe0b8
Compare
4bbe0b8 to
3e1a65d
Compare
A handful of test infrastructure fixes needed once the queue runner and
builder use distinct physical Nix stores sharing the same logical
store dir.
- `HydraTestContext`: create the builder and central roots up front
with `make_path` (the `local?root=...` store won't initialise
otherwise), and give the builder its own `nix_state_dir` /
`nix_log_dir` fields alongside the existing `nix_store_dir`.
- `QueueRunnerBuildOne`:
- Set `NIX_STORE_DIR` when starting `hydra-builder` with a `TODO`
note: the builder currently reads this to advertise its logical
store dir to the queue runner; it should take the value from the
store URI instead.
- Pump the queue-runner `IPC::Run` harness alongside the builder
and flush accumulated stderr on every poll, so when a test hangs
we actually see the queue runner's logs instead of a blank
"Builder stderr: ..." wall.
- `queue-runner/notifications.t`: the "prebuild into a binary cache"
preamble uses `nix-build` / `nix copy` / `nix log` / `nix-store`
directly, which inherits the central store URI. That store has
physical != logical, so building derivations whose `$PATH` points
at the host `/nix/store/...-coreutils/bin` fails with `mkdir: not
found`. Point all of these at the builder store (which has physical
= logical) via `--store`, and clean up the builder's log dir at
the end of the subtest instead of the central one.
This also makes sure that the test doesn't rely on `nix-build` etc.
doing things to the central / queue runner's store that we didn't
realize, so we don't accidentally rely on those things (e.g. the test
would fail without them.)
3e1a65d to
08c10ec
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.