mirror of
https://github.com/NixOS/nix
synced 2025-07-08 11:03:54 +02:00
Add support for the build-timeout' and
--timeout' options.
This commit is contained in:
parent
9c99aa2620
commit
5c9e9f732d
12 changed files with 115 additions and 5 deletions
24
tests/timeout.sh
Normal file
24
tests/timeout.sh
Normal file
|
@ -0,0 +1,24 @@
|
|||
# Test the `--timeout' option.
|
||||
|
||||
source common.sh
|
||||
|
||||
drvPath=$($nixinstantiate timeout.nix)
|
||||
|
||||
test "$($nixstore -q --binding system "$drvPath")" = "$system"
|
||||
|
||||
echo "derivation is $drvPath"
|
||||
|
||||
failed=0
|
||||
messages="`$nixstore -r --timeout 2 $drvPath 2>&1 || failed=1`"
|
||||
if test $failed -ne 0; then
|
||||
echo "error: \`nix-store' succeeded; should have timed out" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! echo "$messages" | grep "timed out"; then
|
||||
echo "error: \`nix-store' may have failed for reasons other than timeout" >&2
|
||||
echo >&2
|
||||
echo "output of \`nix-store' follows:" >&2
|
||||
echo "$messages" >&2
|
||||
exit 1
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue