fix: Deduplicate stores to work around nix#11979

Fixes tests hanging. Before this commit:

    nix build .#packages.x86_64-linux.nixops4-eval-release

See https://github.com/NixOS/nix/issues/11979

(cherry picked from commit 03af71f92488f2ee683565318f24afd3e3c001df)
This commit is contained in:
Robert Hensing 2024-11-27 14:13:54 +01:00
parent 1c0e2cd72f
commit 12d3d62108
2 changed files with 52 additions and 4 deletions

View file

@ -594,7 +594,8 @@ mod tests {
fn weak_ref_gone() {
gc_registering_current_thread(|| {
let weak = {
let store = Store::open("auto", HashMap::new()).unwrap();
// Use a slightly different URL which is unique in the test suite, to bypass the global store cache
let store = Store::open("auto?foo=bar", HashMap::new()).unwrap();
let es = EvalState::new(store, []).unwrap();
es.weak_ref()
};