Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

t: Make process handling more robust with IPC::Run #3123

Merged
merged 1 commit into from May 29, 2020

Conversation

okurz
Copy link
Member

@okurz okurz commented May 28, 2020

Whenever processes are spawned they need to be tracked properly for
cleanup. This posed problems of sometimes leaking orphans when tests are
aborted or crashed. As we already use IPC::Run we can use the same for
other cases where we spawn processes with fork by using IPC::Run::start
instead. Additional benefits are that we can debug the process handling
and IPC going with https://metacpan.org/pod/IPC::Run#Debugging-Tip as
well as be able to catch output of the processes.

One example of a recent problem that should be fixed by this is
t/05-scheduler-full.t failing to stop completely when individual test
steps fail. This prevents the RETRY on the level of tools/retry and the
Makefile to work as the former test never completely finishes and is
stuck until the CI aborts the complete test run without further retries.

https://progress.opensuse.org/issues/59043

t/05-scheduler-full.t Outdated Show resolved Hide resolved
my ($h, $forced) = @_;
return unless $h;
if ($forced) {
$h->kill_kill(grace => 3);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we handle the exception and print a warning? Otherwise it presumably breaks the test plan in that case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it does. This is basically still the same we were doing in before, we send TERM and then KILL if the parameter was given

Whenever processes are spawned they need to be tracked properly for
cleanup. This posed problems of sometimes leaking orphans when tests are
aborted or crashed. As we already use IPC::Run we can use the same for
other cases where we spawn processes with fork by using IPC::Run::start
instead. Additional benefits are that we can debug the process handling
and IPC going with https://metacpan.org/pod/IPC::Run#Debugging-Tip as
well as be able to catch output of the processes.

One example of a recent problem that should be fixed by this is
t/05-scheduler-full.t failing to stop completely when individual test
steps fail. This prevents the RETRY on the level of tools/retry and the
Makefile to work as the former test never completely finishes and is
stuck until the CI aborts the complete test run without further retries.

https://progress.opensuse.org/issues/59043
@okurz okurz marked this pull request as draft May 28, 2020 13:47
@okurz
Copy link
Member Author

okurz commented May 28, 2020

Test fails with

[13:35:45] t/05-scheduler-full.t ..................... 5/? # Looks like your test exited with 9 just after 5.
[13:35:45] t/05-scheduler-full.t .....................      Dubious, test returned 9 (wstat 2304, 0x900)
All 5 subtests passed 

but I could not reproduce this locally

@perlpunk
Copy link
Contributor

Also works for me locally. Maybe run prove with -v to get more info?

@okurz
Copy link
Member Author

okurz commented May 28, 2020

We do have all artifacts available. In https://app.circleci.com/pipelines/github/os-autoinst/openQA/3049/workflows/51f1299a-215e-47e1-85e1-baaf4dde7d56/jobs/29008 I reran also with ssh and both that run succeeded as well as my run within the ssh session

@codecov
Copy link

codecov bot commented May 28, 2020

Codecov Report

Merging #3123 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3123   +/-   ##
=======================================
  Coverage   92.05%   92.05%           
=======================================
  Files         211      211           
  Lines       12932    12932           
=======================================
  Hits        11904    11904           
  Misses       1028     1028           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e0f2892...7285b1a. Read the comment docs.

@okurz okurz marked this pull request as ready for review May 28, 2020 17:46
@okurz
Copy link
Member Author

okurz commented May 28, 2020

All problems fixed. Somehow I have the feeling the observed problems where somewhat temporary in circle CI

@kalikiana kalikiana merged commit 2508bce into os-autoinst:master May 29, 2020
@okurz okurz deleted the enhance/ipc_run branch May 29, 2020 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants