micropython / micropython/micropython
tests: extmod/time_time_ns.py intermittent failure due to CI runner clock precision
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 22.1k
- Forks
- 9k
- Avg merge
- 6d 4h
- Merged PRs (30d)
- 16
Description
The time_time_ns.py test makes assertions about time.time_ns() precision
that intermittently fail on shared CI runners. Observed in the float (1)
and longlong (1) jobs in a 20-run log window. Attributed to ~7 of 103
failed runs over 14 months.
On shared CI runners the wall clock can have insufficient precision or
the process can be descheduled between measurements, causing timing
assertions to return False instead of True.
This one might be addressable by increasing the tolerance in the test
rather than fixing underlying code.
PR #18861 now ignores this failure in CI.
See analysis: https://gist.github.com/andrewleech/5686ed5242e0948d8679c432579e002e
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with extmod/time_time_ns.py and run the test, focusing on the precision assertions in the float and longlong jobs. Review the linked analysis and inspect how the test measures time; done means the test remains meaningful without intermittent failures on shared CI runners, including the cases currently ignored by PR #18861.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot, testing-qa
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100