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

Small runs of zimcheck are now spreading love #288

Merged
merged 1 commit into from
Feb 6, 2022

Conversation

veloman-yunkan
Copy link
Collaborator

Fixes #287

The unit-tests of zimcheck include a report on the total runtime of each flow. Since those flows are very small the corresponding line from the zimcheck output used to be

[INFO] Total time taken by zimcheck: 0 seconds.

which corresponds to the duration of the flow being under half a second.

However, Debian builds and tests zimcheck - among other configurations - on virtualized hardware too. The incurred slowdown results in the runtime exceeding the 0.5 second limit whereupon the performance report changes and the unit-tests fail (#287).

The challenge was to come up with a solution meeting the following requirements:

a. no discrimination between fast and (moderately) slow build environments

b. the performance info is preserved in the output and is not excluded from comparison (so that, in the absence of dedicated
performance testing, it keeps serving as a simple defence against unintended significant slowdown in zimcheck).

Since runtime numbers are mainly justified for large ZIM files, the solution is to report small runtimes as "<X seconds" for some value of X. The latter threshold was set to 3 with the only purpose of further increasing the amount of love in the world.

The unit-tests of zimcheck include a report on the total runtime of each
flow. Since those flows are very small the corresponding line from the
zimcheck output used to be

    [INFO] Total time taken by zimcheck: 0 seconds.

which corresponds to the duration of the flow being under half a second.

However, Debian builds and tests zimcheck - among other configurations -
on virtualized hardware too. The incurred slowdown results in the
runtime exceeding the 0.5 second limit whereupon the performance report
changes and the unit-tests fail (#287).

The challenge was to come up with a solution meeting the following
requirements:

a. no discrimination between fast and (moderately) slow build environments

b. the performance info is preserved in the output and is not
   excluded from comparison (so that, in the absence of dedicated
   performance testing, it keeps serving as a simple defence
   against unintended significant slowdown in zimcheck).

Since runtime numbers are mainly justified for large ZIM files, the
solution is to report small runtimes as "<X seconds" for some value of
X. The latter threshold was set to 3 with the only purpose of further
increasing the amount of love in the world.
@codecov
Copy link

codecov bot commented Feb 5, 2022

Codecov Report

Merging #288 (d9d2b0b) into master (0930008) will increase coverage by 0.04%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #288      +/-   ##
==========================================
+ Coverage   51.13%   51.18%   +0.04%     
==========================================
  Files          21       21              
  Lines        1936     1940       +4     
  Branches     1146     1152       +6     
==========================================
+ Hits          990      993       +3     
- Misses        942      945       +3     
+ Partials        4        2       -2     
Impacted Files Coverage Δ
src/zimcheck/zimcheck.cpp 80.74% <80.00%> (-0.15%) ⬇️
src/tools.cpp 86.49% <0.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 0930008...d9d2b0b. Read the comment docs.

@legoktm
Copy link
Member

legoktm commented Feb 6, 2022

Very cute :D I think this is reasonable, as a 3 second timeout on the test. I'll cherry-pick this into Debian and see how it goes.

Copy link
Member

@legoktm legoktm left a comment

Choose a reason for hiding this comment

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

All the architectures built successfully in Debian with this patch, so good from my perspective. Thanks!

@kelson42 kelson42 merged commit 321c55c into master Feb 6, 2022
@kelson42 kelson42 deleted the zimcheck_spreading_love branch February 6, 2022 05:56
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.

Tests fail if the machine is slow
3 participants