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

Prevent schedule from being reread unnecessarily #3183

Merged
merged 1 commit into from
Jun 18, 2020

Conversation

perlpunk
Copy link
Contributor

@perlpunk perlpunk commented Jun 17, 2020

This can happen if a test is finished and the new one hasn't started.
(Reproduce by adding a sleep 10 in basetest.pm after $self->done().

The backend will report an empty $running_test, and in this case
$current_test_module should keep its last value.

It will also reduce payload of the status posts, because it previously posted
the status of all tests when $current_test_module was empty.

This also fixes the issue that results of short tests < 10s are only
reported at the end of the job.

Related Issues:

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.

change looks good but as this was and is a very tricky code area I would favor tests a lot! Feel free to mock as much as needed, especially any potential "sleep" calls.

@codecov
Copy link

codecov bot commented Jun 17, 2020

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #3183   +/-   ##
=======================================
  Coverage   91.98%   91.98%           
=======================================
  Files         211      211           
  Lines       12931    12933    +2     
=======================================
+ Hits        11894    11896    +2     
  Misses       1037     1037           
Impacted Files Coverage Δ
lib/OpenQA/Worker/Job.pm 75.55% <100.00%> (+0.07%) ⬆️

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 7390623...64caa7a. Read the comment docs.

@perlpunk
Copy link
Contributor Author

I added a test

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.

Perfect

This can happen if a test is finished and the new one hasn't started.
(Reproduce by adding a `sleep 10` in basetest.pm after `$self->done()`.

The backend will report an empty `$running_test`, and in this case
`$current_test_module` should keep its last value.

It will also reduce payload of the status posts, because it previously posted
the status of *all* tests when `$current_test_module` was empty.

This also fixes the issue that results of short tests < 10s are only
reported at the end of the job.

Related Issues:
* https://progress.opensuse.org/issues/58826
* https://progress.opensuse.org/issues/58700
* https://progress.opensuse.org/issues/67972
@okurz okurz merged commit 560f446 into os-autoinst:master Jun 18, 2020
@perlpunk perlpunk deleted the schedule-reload branch June 18, 2020 08:53
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