about summary refs log tree commit diff
path: root/tests/fixed.nix.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-08-28T09·21+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-08-28T09·21+0000
commit455a7b95776440a56fd5d545d3b9a01cbae1d8e7 (patch)
treec87976d51fd4b07fb4128585f85407c21550e2b6 /tests/fixed.nix.in
parent7d5836b34df363c2b2e7fc1574aaba1dde9a697e (diff)
* Test case to show that parallel builds of different fixed-output
  derivations that produce the same output path don't work properly
  wrt locking.  This happens a lot in the build farm when fetchurl
  derivations downloading the same file on different platforms are
  executed in parallel and then copied back to the main machine.

Diffstat (limited to 'tests/fixed.nix.in')
-rw-r--r--tests/fixed.nix.in12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/fixed.nix.in b/tests/fixed.nix.in
index ab2448871dbe..47eff91e059f 100644
--- a/tests/fixed.nix.in
+++ b/tests/fixed.nix.in
@@ -1,6 +1,6 @@
 rec {
 
-  f = builder: mode: algo: hash: derivation {
+  f2 = dummy: builder: mode: algo: hash: derivation {
     name = "fixed";
     system = "@system@";
     builder = "@shell@";
@@ -9,8 +9,11 @@ rec {
     outputHashAlgo = algo;
     outputHash = hash;
     PATH = "@testPath@";
+    inherit dummy;
   };
 
+  f = f2 "";
+
   good = [
     (f ./fixed.builder1.sh "flat" "md5" "8ddd8be4b179a529afa5f2ffae4b9858")
     (f ./fixed.builder1.sh "flat" "sha1" "a0b65939670bc2c010f4d5d6a0b3e4e4590fb92b")
@@ -35,4 +38,11 @@ rec {
     (f ./fixed.builder1.sh "flat" "md5" "ddd8be4b179a529afa5f2ffae4b9858")
   ];
 
+  # Test for building two derivations in parallel that produce the
+  # same output path because they're fixed-output derivations.
+  parallelSame = [
+    (f2 "foo" ./fixed.builder2.sh "flat" "md5" "3670af73070fa14077ad74e0f5ea4e42")
+    (f2 "bar" ./fixed.builder2.sh "flat" "md5" "3670af73070fa14077ad74e0f5ea4e42")
+  ];
+
 }
\ No newline at end of file