mx-test.sh: catch wild (Chet Ramey,Robert Elz,Jilles Tjoelker,Steve Izma)..
After hours of tunnel syndrome on Saturday night, when implementing
(mx-test.sh: support test parallelization, 2019-07-31) (for real)
i posted a bug report on asynchronous childs to the bash bug list.
Not really a bug i said though. The real problem that came out of
me as wicked as usual was that Matthew Dillon reported up to 450000
execs per seconds statically and 45000 dynamically on DragonFly
BSD 5.6 with a Threadripper box. Luckily the wonderful Robert Elz
stepped in and made me straight enough that i could report that real
problem.
They also came up with the solution: do not wait(1) on child
processes until we know about their state, so that anytime before we
actually do wait(1) we can safely kill(1) them (Jilles Tjoelker).
Thus, let's create a FIFO (Chet Ramey) to get a synchronized
device, strip the wild test undertaker to a core that only writes
"timeout" to that FIFO, and also improve its startup-is-completed to
simply send a signal to the parent process (Robert Elz). So
either the tests finish nicely, in which case they write their job
number to the fifo, or we see "timeout" and kill all remains.
There is still a minimal race which would falsely report tests as
failures, but should do no other harm.
Thanks, and sorry for the noise.