Skip to content

tests/extmod: Make uasyncio_fair test more reliable by adjusting sleeps. #6374

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

Merged
merged 1 commit into from
Aug 26, 2020

Conversation

dpgeorge
Copy link
Member

With sleep(0.2) a multiple of sleep(0.1), the order of task 2 and 3 execution is not well defined, and depends on the precision of the system clock and how fast the rest of the code runs. So change 0.2 to 0.18 to make the test more reliable.

Also fix a typo of t3/t4, and cancel t4 at the end.

@dpgeorge dpgeorge added the tests Relates to tests/ directory in source label Aug 26, 2020
With sleep(0.2) a multiple of sleep(0.1), the order of task 2 and 3
execution is not well defined, and depends on the precision of the system
clock and how fast the rest of the code runs.  So change 0.2 to 0.18 to
make the test more reliable.

Also fix a typo of t3/t4, and cancel t4 at the end.

Signed-off-by: Damien George <damien@micropython.org>
@dpgeorge dpgeorge force-pushed the tests-reliable-asyncio-fair branch from f2dd076 to 5fb276d Compare August 26, 2020 07:06
@dpgeorge
Copy link
Member Author

The only failure here is a 1-line change in coverage which is unrelated (?) to the change.

@dpgeorge dpgeorge merged commit 5fb276d into micropython:master Aug 26, 2020
@dpgeorge dpgeorge deleted the tests-reliable-asyncio-fair branch August 26, 2020 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Relates to tests/ directory in source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant