From 9c9a7e00829169a68ee9ec0c6e5d2071ae1285b5 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Tue, 12 Sep 2023 01:06:37 +0200 Subject: [PATCH] tests.nixpkgs-check-by-name: Fix with parallel tests We seem to have enough tests to run into this now: error: creating symlink from '/private/tmp/nix-build-nixpkgs-check-by-name.drv-0/source/test-tmp/var/nix/gcroots/profiles' to '/private/tmp/nix-build-nixpkgs-check-by-name.drv-0/source/test-tmp/var/nix/profiles': File exists --- pkgs/test/nixpkgs-check-by-name/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/test/nixpkgs-check-by-name/default.nix b/pkgs/test/nixpkgs-check-by-name/default.nix index a997fc8612c8..cb8a672bc990 100644 --- a/pkgs/test/nixpkgs-check-by-name/default.nix +++ b/pkgs/test/nixpkgs-check-by-name/default.nix @@ -25,6 +25,10 @@ let export NIX_LOG_DIR=$TEST_ROOT/var/log/nix export NIX_STATE_DIR=$TEST_ROOT/var/nix export NIX_STORE_DIR=$TEST_ROOT/store + + # cargo tests run in parallel by default, which would then run into + # https://github.com/NixOS/nix/issues/2706 unless the store is initialised first + nix-store --init ''; postCheck = '' cargo fmt --check