aboutsummaryrefslogtreecommitdiff
path: root/tests/ca/concurrent-builds.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ca/concurrent-builds.sh')
-rwxr-xr-xtests/ca/concurrent-builds.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ca/concurrent-builds.sh b/tests/ca/concurrent-builds.sh
new file mode 100755
index 000000000..68441ec76
--- /dev/null
+++ b/tests/ca/concurrent-builds.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+# Ensure that we can’t build twice the same derivation concurrently.
+# Regression test for https://github.com/NixOS/nix/issues/5029
+
+source common.sh
+
+sed -i 's/experimental-features .*/& ca-derivations ca-references/' "$NIX_CONF_DIR"/nix.conf
+
+export NIX_TESTS_CA_BY_DEFAULT=1
+
+clearStore
+
+for i in {0..5}; do
+ nix build --no-link --file ./racy.nix &
+done
+
+wait