lix/tests/timeout.nix
Eelco Dolstra 21948deed9
Kill builds when we get EOF on the log FD
This closes a long-time bug that allowed builds to hang Nix
indefinitely (regardless of timeouts) simply by doing

  exec > /dev/null 2>&1; while true; do true; done

Now, on EOF, we just send SIGKILL to the child to make sure it's
really gone.
2017-01-19 17:16:14 +01:00

29 lines
455 B
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

with import ./config.nix;
{
infiniteLoop = mkDerivation {
name = "timeout";
buildCommand = ''
echo "timeout builder entering an infinite loop"
while true ; do echo -n .; done
'';
};
silent = mkDerivation {
name = "silent";
buildCommand = ''
sleep 60
'';
};
closeLog = mkDerivation {
name = "silent";
buildCommand = ''
exec > /dev/null 2>&1
sleep 1000000000
'';
};
}