tvl-depot/tests/gc-concurrent.sh
Eelco Dolstra a7668411a1 * Add a test to check whether concurrent garbage collection (i.e.,
running the collector while builds are in progress) works
  correctly.  The test currently fails.
2005-01-28 20:36:46 +00:00

19 lines
510 B
Bash

storeExpr=$($TOP/src/nix-instantiate/nix-instantiate gc-concurrent.nix)
outPath=$($TOP/src/nix-store/nix-store -q $storeExpr)
# Start a build in the background.
$TOP/src/nix-store/nix-store -rvv "$storeExpr" &
pid=$!
# Run the garbage collector while the build is running.
sleep 2
$NIX_BIN_DIR/nix-collect-garbage
# Wait for the build to finish.
echo waiting for pid $pid to finish...
wait $pid
# Check that the root and its dependencies haven't been deleted.
cat $outPath/foobar
cat $outPath/input-2/bar