Print expected and actual spec duration in job log
What does this MR do and why?
Adds the following job log to show example group duration and elapsed time after running each example group:
Example group RSpec::ExampleGroups::User took 3 minutes 14.71 seconds.
RSpec timer is at 100942.04477. RSpec elapsed time: 3 minutes 20.04 seconds.
...
Example group RSpec::ExampleGroups::Ability took 0 minutes 11.21 seconds.
RSpec timer is at 100953.257565. RSpec elapsed time: 3 minutes 31.26 seconds.
This will allow us to have access to run time information throughout job and have more troubleshooting data when a job times out.
The MR also parses the expected duration for the test suite as predicted by Knapsack. It will upload a new artifact file "knapsack/expected_duration_report.json" to list the expected run time for each test file. This way we can compare how well Knapsack was able to predict and distribute tests for this job.
This can help set up troubleshooting trace for Create process to troubleshoot Knapsack scheduling (gitlab-org/quality/engineering-productivity/team#301 - closed)
How to verify
Run GITLAB_CI=true bundle exec rspec spec/models/user_spec.rb spec/models/ability_spec.rb
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.