mx-test.sh: catch wild (Chet Ramey,Robert Elz,Jilles Tjoelker,Steve Izma)..
commit12798bd4eaf9d2108edaf9585a85d2a27bb7ddf8
authorSteffen Nurpmeso <steffen@sdaoden.eu>
Wed, 7 Aug 2019 17:49:30 +0000 (7 19:49 +0200)
committerSteffen Nurpmeso <steffen@sdaoden.eu>
Sat, 17 Aug 2019 22:12:43 +0000 (18 00:12 +0200)
tree5c50e7f5912f1743bba6aae568a63c88d8affd48
parente03fd7bb2f2b15e7c7f6dd916f20190b20b1d8bb
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.
mx-test.sh