Skip to content

Conversation

@nolar
Copy link
Owner

@nolar nolar commented Dec 26, 2021

Utilise a new library — https://github.com/nolar/looptime — to have a fake time in event loops. The library does a lot of things, but the most important one is the sharp time with predictable steps with no code overhead included, which is typically random.

Everything else goes as a side-effect: e.g. the fast execution of such tests with zero real-time for any fake duration of loop time, convenient looptime fixture for assertions, etc.

This PR also demonstrates how the tests can be rewritten to use the provided looptime's features (and is mentioned in its README).

Fixes #212; related: #338

Preparational PRs:

@nolar nolar added the automation CI/CD: testing, linting, releasing automatically label Dec 26, 2021
@nolar nolar force-pushed the faketime branch 3 times, most recently from e0f78f3 to 9c8ab16 Compare December 31, 2021 21:01
@lgtm-com
Copy link

lgtm-com bot commented Jul 24, 2022

This pull request introduces 1 alert when merging 420fa17 into 7b45690 - view on LGTM.com

new alerts:

  • 1 for Unused import

@nolar nolar force-pushed the faketime branch 2 times, most recently from 480ab08 to 687228d Compare July 30, 2023 19:08
Utilise a new library — https://github.com/nolar/looptime — to have a fake time in event loops. The library does a lot of things, but the most important one is the sharp time with predictable steps with **no code overhead included**, which is typically random.

Everything else goes as a side-effect: e.g. the fast execution of such tests with zero real-time for any fake duration of loop time, convenient `looptime` fixture for assertions, etc.

Signed-off-by: Sergey Vasilyev <[email protected]>
@nolar nolar merged commit 1034fe5 into main Jan 3, 2026
39 checks passed
@nolar nolar deleted the faketime branch January 3, 2026 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation CI/CD: testing, linting, releasing automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stabilise the time-based tests with asyncio sleeps/timeouts

2 participants