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

Allow monitor command to skip aborted jobs #6101

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/OpenQA/CLI/monitor.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ sub _monitor_jobs ($self, $client, $poll_interval, $job_ids, $job_results) {
if (OpenQA::Jobs::Constants::meta_state($job_state) eq OpenQA::Jobs::Constants::FINAL) {
push @$job_results, $job->{result} // NONE;
next;
} elsif (OpenQA::Jobs::Constants::meta_state($job_state) eq OpenQA::Jobs::Constants::ABORTED_RESULTS) {
Copy link
Contributor

Choose a reason for hiding this comment

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

It's still a draft, but I would mention that this should probably be configurable. An aborted result usually not considered as successful.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, obsoleted is a result and not a state. Any job will sooner or later be in a FINAL state.

Copy link
Contributor

@Martchus Martchus Jan 9, 2025

Choose a reason for hiding this comment

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

This condition doesn't make much sense. meta_state returns meta-state for the specified concrete state but this check compares it to a list of results.

But yes, as @perlpunk has already mentioned, this should be configurable anyway.

So this should probably ignore the results SKIPPED and OBSOLETED or maybe for the sake of completeness the whole meta-result ABORTED. Not sure how much sense it makes to deal with the meta constants here when making this configurable anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

And the check should be done in _compute_return_code, not here

print encode('UTF-8',
"Job $job_id was aborted but did not fail ($job_state), hence skipping)\n");
push @$job_results, $job->{result} // NONE;
next;
}
my $waited = time - $start;
print encode('UTF-8',
Expand Down
Loading