mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
Add a test for the non-blocking GC
This commit is contained in:
parent
ac54c6faa6
commit
10f9a8e77d
3 changed files with 38 additions and 0 deletions
33
tests/gc-non-blocking.sh
Normal file
33
tests/gc-non-blocking.sh
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Test whether the collector is non-blocking, i.e. a build can run in
|
||||
# parallel with it.
|
||||
source common.sh
|
||||
|
||||
needLocalStore "the GC test needs a synchronisation point"
|
||||
|
||||
clearStore
|
||||
|
||||
fifo=$TEST_ROOT/test.fifo
|
||||
mkfifo "$fifo"
|
||||
|
||||
dummy=$(nix store add-path ./simple.nix)
|
||||
|
||||
running=$TEST_ROOT/running
|
||||
touch $running
|
||||
|
||||
(_NIX_TEST_GC_SYNC=$fifo nix-store --gc -vvvvv; rm $running) &
|
||||
pid=$!
|
||||
|
||||
sleep 2
|
||||
|
||||
outPath=$(nix-build -o "$TEST_ROOT/result" -E "
|
||||
with import ./config.nix;
|
||||
mkDerivation {
|
||||
name = \"non-blocking\";
|
||||
buildCommand = \"set -x; test -e $running; mkdir \$out; echo > $fifo\";
|
||||
}")
|
||||
|
||||
wait $pid
|
||||
|
||||
(! test -e $running)
|
||||
(! test -e $dummy)
|
||||
test -e $outPath
|
|
@ -4,6 +4,7 @@ nix_tests = \
|
|||
gc.sh \
|
||||
ca/gc.sh \
|
||||
gc-concurrent.sh \
|
||||
gc-non-blocking.sh \
|
||||
gc-auto.sh \
|
||||
referrers.sh user-envs.sh logging.sh nix-build.sh misc.sh fixed.sh \
|
||||
gc-runtime.sh check-refs.sh filter-source.sh \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue