diff options
Diffstat (limited to 'tests/gc-auto.sh')
-rw-r--r-- | tests/gc-auto.sh | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/tests/gc-auto.sh b/tests/gc-auto.sh index 06f5f0795..a74c675b0 100644 --- a/tests/gc-auto.sh +++ b/tests/gc-auto.sh @@ -17,42 +17,50 @@ expr=$(cat <<EOF with import ./config.nix; mkDerivation { name = "gc-A"; buildCommand = '' + set -x [[ \$(ls \$NIX_STORE/*-garbage? | wc -l) = 3 ]] mkdir \$out echo foo > \$out/bar echo 1... sleep 2 - echo 200 > $fake_free + echo 200 > ${fake_free}.tmp1 + mv ${fake_free}.tmp1 $fake_free echo 2... sleep 2 echo 3... + sleep 2 + echo 4... [[ \$(ls \$NIX_STORE/*-garbage? | wc -l) = 1 ]] ''; } EOF ) -nix build --impure -v -o $TEST_ROOT/result-A -L "($expr)" \ - --min-free 1000 --max-free 2000 --min-free-check-interval 1 & -pid=$! - expr2=$(cat <<EOF with import ./config.nix; mkDerivation { name = "gc-B"; buildCommand = '' + set -x mkdir \$out echo foo > \$out/bar echo 1... sleep 2 - echo 200 > $fake_free + echo 200 > ${fake_free}.tmp2 + mv ${fake_free}.tmp2 $fake_free echo 2... sleep 2 echo 3... + sleep 2 + echo 4... ''; } EOF ) +nix build --impure -v -o $TEST_ROOT/result-A -L "($expr)" \ + --min-free 1000 --max-free 2000 --min-free-check-interval 1 & +pid=$! + nix build --impure -v -o $TEST_ROOT/result-B -L "($expr2)" \ --min-free 1000 --max-free 2000 --min-free-check-interval 1 |