]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/run.perl: less confusing error reporting
authorEric Wong <e@80x24.org>
Sun, 26 Sep 2021 01:42:38 +0000 (01:42 +0000)
committerEric Wong <e@80x24.org>
Sun, 26 Sep 2021 01:43:36 +0000 (01:43 +0000)
The $sigchld handler was reporting the last test (successful or
not) for a given PID in case a worker dies prematurely.
Instead, redisplay all failed test in $run_log to ensure the
report only shows failed tests, and not the last started (and
possibly successful) one.

t/run.perl

index 0fe6d08bb9c4c78a87de11a055a5bf61262baf61..cf80a8a17ecedc54304d5280744e5b5d857e4209 100755 (executable)
@@ -183,7 +183,10 @@ my $start_worker = sub {
                        $tb->reset;
                }
                kill 'USR1', $producer if !$eof; # sets $eof in $producer
-               DIE join('', map { "E: $_\n" } @err) if @err;
+               if (@err) { # write to run_log for $sigchld handler
+                       syswrite($run_log, "$$ @err\n");
+                       DIE join('', map { "E: $_\n" } @err);
+               }
                exit(0);
        } else {
                $pids{$pid} = $j;