To match the behavior of the previous ptest-runner, only collect system state when a test has timed out
Signed-off-by: Joshua Watt <[email protected]> --- utils.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/utils.c b/utils.c index 34ca2f0..d0e6a99 100644 --- a/utils.c +++ b/utils.c @@ -556,21 +556,18 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts, } } } - collect_system_state(_child_reader.fps[0]); - for (int i = 0; i < 2; i++) { - fflush(_child_reader.fps[i]); - } - - /* - * This kill is just in case the child did - * something really silly like close its - * stdout and stderr but then go into an - * infinite loop and never exit. Normally, it - * will just fail because the child is already - * dead - */ - if (!_child_reader.timeouted) { + if (_child_reader.timeouted) { + collect_system_state(fp); + } else { + /* + * This kill is just in case the child did + * something really silly like close its + * stdout and stderr but then go into an + * infinite loop and never exit. Normally, it + * will just fail because the child is already + * dead + */ kill(-child, SIGKILL); } waitpid(child, &status, 0); -- 2.33.0
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#60606): https://lists.yoctoproject.org/g/yocto/message/60606 Mute This Topic: https://lists.yoctoproject.org/mt/100220150/21656 Group Owner: [email protected] Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
