If was found during stress-test run that a test may hang by 60 seconds. It supposedly happens because SIGCHILD was received before sleep has started. Fix by looping by smaller chunks, checking $exited after each of them. Then lost SIGCHILD would not cause longer delay than 1 second. Reported-by: SZEDER Gábor <szeder.dev@xxxxxxxxx> Signed-off-by: Max Kirillov <max@xxxxxxxxxx> --- Submitting as proper patch. Note: I believe it does not relate to other issues discussed in this thread. t/t5562/invoke-with-content-length.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/t5562/invoke-with-content-length.pl b/t/t5562/invoke-with-content-length.pl index 0943474af2..257e280e3b 100644 --- a/t/t5562/invoke-with-content-length.pl +++ b/t/t5562/invoke-with-content-length.pl @@ -29,7 +29,12 @@ } print $out $body_data or die "Cannot write data: $!"; -sleep 60; # is interrupted by SIGCHLD +my $counter = 0; +while (not $exited and $counter < 60) { + sleep 1; + $counter = $counter + 1; +} + if (!$exited) { close($out); die "Command did not exit after reading whole body"; -- 2.19.0.1202.g68e1e8f04e