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

Anibal Limon

On Wed, 24 Mar 2021 at 09:56, Yi Fan Yu <yifan.yu@...> wrote:
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

Yeah, thanks for remind me the old behavior, some years and I forget about it, I will fix it and put certain comments about that.

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.

I pushed to dev branch,



Join { to automatically receive all group messages.