From 08500cfcbb91cda09c6790b916ba97c333cf2df9 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 12 Nov 2026 20:01:47 +0000 Subject: populate: stop the ssh master also when a signal ends populate The shell doesn't run the EXIT trap when a signal ends it, so an interrupted deploy leaves the ssh master, for an hour, and populate's temporary directory. Populate traps HUP, INT, and TERM and exits, which runs the EXIT trap. The shell runs a trap once the command it waits for ends. A signal to the process group, like the one of an interrupt key, of a closed terminal, or of timeout, ends that command as well. A signal to populate alone takes effect after the step that is running. Phases of scenarios can end populate after some seconds. An edge case does so while a pipe source's command sleeps, and checks that neither the ssh master nor the temporary directory remain. --- tests/fixtures.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/fixtures.sh') diff --git a/tests/fixtures.sh b/tests/fixtures.sh index 4e794db..ccd55a0 100755 --- a/tests/fixtures.sh +++ b/tests/fixtures.sh @@ -337,6 +337,14 @@ echo piped SH chmod +x /fixtures/pipe +# pipe-slow: a command that takes longer than the tests wait for it. +cat > /fixtures/pipe-slow <<'SH' +#! /bin/sh +sleep 60 +echo piped +SH +chmod +x /fixtures/pipe-slow + # patches: hello and hello2 change dep's greeting, hello2 only after hello; # sub changes the flake in mono's subdirectory; bad applies to nothing. mkdir -p /fixtures/patches -- cgit v1.3.1