Re: [ptest-runner][PATCH 4/4] utils.c: wait_child reimplement timeout using alarm


Yi Fan Yu
 

On 3/22/21 10:10 PM, Aníbal Limón wrote:
Since we are using threads to read from child, no complex logic is
needed for handle timeouts use alarm(2).
TY for the patches.

This would change its behaviour to timeout exactly at X seconds.

New behaviour: if test exceeds X seconds, gets killed.
Old behaviour: if test exceeds X seconds with no output, get killed. If output is detected X-1 seconds, the timeout timer resets.
so a program could take 2X seconds and not get killed


Comment about the other patches:

We don't even need an extra thread because before the wait_for_child had to do 2 things:

* read a pipe and output that pipe to stdout (child_reader does that)
* check for timeout (sigalarm takes care of that now)



last thing, can you push this to a branch (let's say) master-next, so I can test it with a full ptest run.

yifan

Join yocto@lists.yoctoproject.org to automatically receive all group messages.