-
Notifications
You must be signed in to change notification settings - Fork 12
Add check for slow tests to CI #1033
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
Add check for slow tests to CI #1033
Conversation
d3e68ee to
deed495
Compare
DominicOram
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you. I think once we merge into main it will pass again as I moved the CLI test in #1000. Only issue is that it now looks like the tests are being run twice? The logs are printing results twice and if you compare the time on https://github.com/DiamondLightSource/dodal/actions/runs/13132250037/job/36639728998 to https://github.com/DiamondLightSource/dodal/actions/runs/13133823256/job/36644639445?pr=1033 its ~2x the time.
|
looking into it now update: noticed where is this happening |
519fb11 to
8535a08
Compare
|
reproducing lcoally: 1027 passed, 4 skipped, 40 deselected in 31.79s ==================================================================
_____________________________________________________________________________________ summary ______________________________________________________________________________________
report: commands succeeded
congratulations :)
beginning to suspect that the culprit is pytest that runs twice due to a request to have both coverage and report json for time this line only occurs once in this run https://github.com/DiamondLightSource/dodal/actions/runs/13135068486/job/36648559977?pr=1033 reading the docs... |
|
tried to replicate time doubling on a smaller scale and the undesired doubling does not happen |
should I exclude this? |
|
it's possible that addition of dev-dependency update: the cov.json does not cover time therefore the pytest-json-report is good actually |
No, as I said above, it will be fixed if you merge in |
|
I thought that I had already merged in |
90c7aa7 to
229f472
Compare
Ah, my bad. I think that the solution is that we need different thresholds for system tests vs unit tests. Can we set like a 5s limit on system tests or we can just ignore if they go over the duration, I don't mind which. |
making it 5 s for system tests |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1033 +/- ##
=======================================
Coverage 97.69% 97.69%
=======================================
Files 160 160
Lines 6629 6629
=======================================
Hits 6476 6476
Misses 153 153 ☔ View full report in Codecov by Sentry. |
|
this seems to work now @DominicOram |
|
coverage took a nosedive though |
Similar to above, it's not clear to me from these comments what you feel the next steps are on this? Are you still looking at the coverage issue? Would you like help on it? Do you want me to merge it despite the coverage issue? |
I haven't seen this before, investigating |
01664bd to
7e5c832
Compare
yes I have no idea why is the coverage going down. I have never seen this before. Presumably it'd be good if someone took a look at it too. |
|
atm the CI fail is due to test time: Run python .github/scripts/check_test_durations.py unit-report.json 1
|
I can have a look I am pretty sure they run close to 1 sec but I am not sure about the 3.01s. |
yes the main version definitely took 3 second and it will be fix with #1032. |
Yh, I don't mind solving it like this. But I guess it would be annoying if this meant that:
But I think we can live with these things :)
Ok, I will try and find some time to take a look |
|
============================================= 1050/1090 tests collected (40 deselected) in 5.48s ============================================= for pytest -m 'not (s03 or adsim)' --collect-only while>> and tests: ======================================================= 1048 tests collected in 4.02s ======================================================== so the same number of tests is collected. |
7e5c832 to
9a07d22
Compare
|
waiting for #1032 to be fixed |
372c3dd to
63d628c
Compare
|
@Relm-Arrowny how is that other PR going? |
63d628c to
2702f52
Compare
This is on me to review. I will do so today |
I have not tested it lately but I am 80% sure it run all the test even if it time out and the test will run to completion. The time out just fail it after. |
DominicOram
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thank you! Passing now that the long tests have been fixed
Fixes #1003
Instructions to reviewer on how to test:
print("✅ All tests ran within the acceptable time limit.")orprint("❌ The following tests exceeded the 1s threshold:")happenedChecks for reviewer
dodal connect ${BEAMLINE}