Repository navigation
tests/extmod: Increase timing on uasyncio tests to make more reliable. - #8617
Conversation
Non-real-time systems like Windows, Linux and macOS do not have reliable timing, so increase the sleep intervals to make these tests more likely to pass. Signed-off-by: Damien George <[email protected]>
98166cc to
c90f097
Compare
|
I can't get the macOS tests to pass without drastically increasing the timings, mac has very poor timing resolution (>100ms variation). But otherwise this looks reliable for Windows and Linux, the timings have been increased by about 5x. |
|
Ok on Windows port on my machine |
|
Perhaps we could use (Not relevant to this issue, but for anyone wanting to apply this to a different application with a single CPU, be aware that this will effectively make every other process run very slow if the MicroPython process is CPU bound, i.e. |
Thanks for testing.
I've now tried this and it doesn't help the macOS tests, they still have a few hundred ms variation. |
bc44b8a to
c90f097
Compare
Codecov Report
@@ Coverage Diff @@
## master #8617 +/- ##
=======================================
Coverage 98.22% 98.22%
=======================================
Files 154 154
Lines 20313 20313
=======================================
Hits 19953 19953
Misses 360 360 Continue to review full report at Codecov.
|
Bummer. I did some digging at it appears that It appears that to get accurate timing on macos we need to make threads realtime threads: https://developer.apple.com/library/archive/technotes/tn2169/_index.html I tried the example code from the tech note and it does make a difference. |
Fix weblate synthetic po
This aims to fix #8301, where uasyncio tests can fail on Windows. But they also fail sometimes on Linux, and also regularly on macOS. So increasing the timing seems to be a reasonable solution.