[Toybox] [PATCH] killall.test, pidof.test: deflake.
Rob Landley
rob at landley.net
Fri Oct 11 13:43:07 PDT 2019
On 9/28/19 11:41 AM, enh wrote:
> On Sat, Sep 28, 2019 at 9:38 AM Rob Landley <rob at landley.net> wrote:
>>
>> On 9/19/19 9:45 AM, enh wrote:
>> I don't want a failed test to leave a cpu-eating loop running because I didn't
>> notice and it drained my battery a couple times...
>
> i've actually found that more _useful_ than problematic... i never
> find those kinds of test bugs on my desktop because it has too many
> cores for me to ever notice. but my laptop helpfully gets warm, and we
> can fix the issue.
>
> that said, i have been thinking that maybe we should use setsid(1) or
> something to just automate cleanup, like we clean up temporary
> directories unless asked to keep them.
I was gonna do a thing with containers, but now I'm trying to get mkroot and
qemu to a point they can run the tests in a VM.
The problem with the containers approach is you needed to be root to unshare and
nsenter the way I wanted to last time I tried it, although they were playing
with stuff so you didn't have to anymore? I think? It was a while ago.
The other problem is it doesn't let you test inmod without root no matter what
you do, so... qemu. :)
>> Ok, I've made it as far as:
>>
>> pid="$( (./pidof.test & echo $!)& disown $! )"
>>
>> And it's still hanging, I'm breaking for lunch.
Finally got that checked in: don't use $() instead write the PID to a file from
inside the same kind of subshell killall.test is using, and fish it back out
from the host process.
While I'm there, added -$$ to the filenames of the test thingies just in case 2
are running at once (or debris from a previous run).
Rob
More information about the Toybox
mailing list