mirror of
https://github.com/NixOS/nix
synced 2025-07-07 10:11:47 +02:00
* 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.
This commit is contained in:
parent
22cfdfa246
commit
a7668411a1
4 changed files with 56 additions and 1 deletions
19
tests/gc-concurrent.sh
Normal file
19
tests/gc-concurrent.sh
Normal file
|
@ -0,0 +1,19 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue