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

Retry hook scripts that use the exit code 142 #4718

Merged
merged 1 commit into from Jun 23, 2022
Merged

Conversation

kraih
Copy link
Member

@kraih kraih commented Jun 23, 2022

This patch turns the previous proof of concept into a proper feature for
making hook scripts restartable with a special exit code. The hook
script now runs in a separate Minion job, and all parameters are
configurable with environment variables and job settings.

Progress: https://progress.opensuse.org/issues/112523

@kraih kraih marked this pull request as ready for review June 23, 2022 14:55
@kraih kraih force-pushed the k/restart_hook_scripts branch 2 times, most recently from 5a88c37 to eca2402 Compare June 23, 2022 15:16
Copy link
Member

@okurz okurz left a comment

Choose a reason for hiding this comment

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

I ran count_fail_ratio make test KEEP_DB=1 TESTS=t/10-jobs.t and got 20/20 stable runs.

EDIT: There seems to be a slight runtime increase of t/10-jobs.t. From 20 runs in origin/master the mean runtime is 10.1s, for your change it's 10.35s so an increase of 0.2s. Well, nevermind :)

lib/OpenQA/Task/Job/FinalizeResults.pm Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 23, 2022

Codecov Report

Merging #4718 (106beeb) into master (5fc539e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4718   +/-   ##
=======================================
  Coverage   98.07%   98.08%           
=======================================
  Files         374      375    +1     
  Lines       34673    34752   +79     
=======================================
+ Hits        34007    34086   +79     
  Misses        666      666           
Impacted Files Coverage Δ
lib/OpenQA/Shared/Plugin/Gru.pm 85.71% <ø> (ø)
lib/OpenQA/Task/Job/FinalizeResults.pm 100.00% <100.00%> (ø)
lib/OpenQA/Task/Job/HookScript.pm 100.00% <100.00%> (ø)
t/10-jobs.t 100.00% <100.00%> (ø)

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 5fc539e...106beeb. Read the comment docs.

@kraih
Copy link
Member Author

kraih commented Jun 23, 2022

Shouldn't be much of a runtime increase, since the only delay tests that actually run multiple times use a 0 delay. The test for the 60 second delay exits after the first iteration because perform_minion_jobs does not wait for delayed jobs. 😉

This patch turns the previous proof of concept into a proper feature for
making hook scripts restartable with a special exit code. The hook
script now runs in a separate Minion job, and all parameters are
configurable with environment variables and job settings.

Progress: https://progress.opensuse.org/issues/112523
@kraih kraih removed the request for review from perlpunk June 23, 2022 20:23
@mergify mergify bot merged commit 795d401 into master Jun 23, 2022
openqabot pushed a commit to openqabot/openQA that referenced this pull request Jun 24, 2022
commit 795d401
Merge: ef96c27 106beeb
Author:     mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
AuthorDate: Thu Jun 23 21:10:16 2022 +0000
Commit:     GitHub <noreply@github.com>
CommitDate: Thu Jun 23 21:10:16 2022 +0000

    Merge pull request os-autoinst#4718 from os-autoinst/k/restart_hook_scripts

    Retry hook scripts that use the exit code 142
@okurz okurz deleted the k/restart_hook_scripts branch June 24, 2022 04:50
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

3 participants