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

worker: Improve retrieving extended reason from os-autoinst #3096

Merged
merged 2 commits into from
May 19, 2020

Conversation

Martchus
Copy link
Contributor

  • Take the relevant component into account because for
    https://progress.opensuse.org/issues/64884 we need to distinguish
    between test crashes and backend crashes
  • Ensure retrieving the extended reason does not interfere with stop
    reasons from the worker itself by handling worker-specific stop reasons
    first

With a change in os-autoinst to propagate the relevant component it will
look like this:

Reason: tests died: unable to load, check the log for the cause (e.g. syntax error)
Reason: backend died: Migrate to file failed

@Martchus Martchus force-pushed the improve-loading-extended-reason branch from 9bb5bdc to 769db42 Compare May 15, 2020 16:24
}
}
catch {
$reason = "$reason: Corrupted state file could not be read";
if ($reason eq 'done') {
$reason = "$reason: terminated with corrupted state file";
Copy link
Member

Choose a reason for hiding this comment

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

Can we find a phrasing that includes a user action? If I would read this as user I would ask "So, what now?"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The user might file an os-autoinst bug after checking that everything was setup correctly. Of course the same it true for Reason: backend died: Migrate to file failed mentioned as example in the commit message.

Not sure whether it makes sense to include a hint like that. They usually file bugs when they see incompletes and can not make sense of them anyways.

Copy link
Member

Choose a reason for hiding this comment

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

I see. But under which circumstances could this fail in this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From the point of view of openQA this JSON file is provided by an external source (os-autoinst and any user can mess with it) so it makes sense to validate the input here (as it was already the case before my changes) and report possible problems. In this case it would be especially bad to let an exception pass because the worker should in any case mark the job as done.

Copy link
Member

Choose a reason for hiding this comment

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

hm, fine

* Take the relevant component into account because for
  https://progress.opensuse.org/issues/64884 we need to distinguish
  between test crashes and backend crashes
* Ensure retrieving the extended reason does not interfere with stop
  reasons from the worker itself by handling worker-specific stop reasons
  first (and fix tests which were expecting that)

With a change in os-autoinst to propagate the relevant component it will
look like this:
```
Reason: tests died: unable to load, check the log for the cause (e.g. syntax error)
Reason: backend died: Migrate to file failed
```
…carding it

It is still a good idea to limit the reason but I suppose it make sense to pass
the first line at least. Otherwise we needed to be very careful on the
os-autoinst side not to produce multi-line error messages.
@Martchus Martchus force-pushed the improve-loading-extended-reason branch from 769db42 to 3f747c2 Compare May 18, 2020 14:01
@Martchus Martchus marked this pull request as ready for review May 18, 2020 14:01
@codecov
Copy link

codecov bot commented May 18, 2020

Codecov Report

Merging #3096 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3096   +/-   ##
=======================================
  Coverage   92.02%   92.02%           
=======================================
  Files         211      211           
  Lines       12845    12851    +6     
=======================================
+ Hits        11820    11826    +6     
  Misses       1025     1025           
Impacted Files Coverage Δ
lib/OpenQA/Worker/Engines/isotovideo.pm 93.85% <100.00%> (ø)
lib/OpenQA/Worker/Job.pm 74.96% <100.00%> (+0.23%) ⬆️

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 01ccfa9...3f747c2. Read the comment docs.

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.

Very nice. Cleaner than in before, fixed the "quit" mistake and added more functionality.

@Martchus Martchus merged commit 43daed0 into os-autoinst:master May 19, 2020
@Martchus Martchus deleted the improve-loading-extended-reason branch May 19, 2020 09:31
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.

3 participants