-
-
Notifications
You must be signed in to change notification settings - Fork 372
Make autojump/autojump_threshold methods of abc.Clock
#3371
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project check has failed because the head coverage (99.99484%) is below the target coverage (100.00000%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3371 +/- ##
====================================================
- Coverage 100.00000% 99.99484% -0.00517%
====================================================
Files 128 128
Lines 19407 19398 -9
Branches 1318 1316 -2
====================================================
- Hits 19407 19397 -10
- Partials 0 1 +1
🚀 New features to boost your workflow:
|
a666494 to
25289f1
Compare
for more information, see https://pre-commit.ci
|
Following some discussion in #3369, the first commit now represents the minimum change - the new methods in the ABC have default implementations, so the PR is not breaking. But the whole handling of the clock in the event loops feels a little weird to me. So I tried to re-imagine the logic in the second commit. The idea is, we have real time (system time), and virtual time (clock time). These should not be mixed. The runner's statistics work with virtual times. In Thus the responsibility of the clock is to keep virtual time, and to convert it to real time when necessary. When we
The second argument in |
Fixes #3369 by exposing
autojumpandautojump_thresholdas methods ofabc.Clock.runner.clock_autojump_thresholdis removed, and the runner now gets it fromclock.TODO: adjust documentation (
autoump_thresholddescription can be moved fromMockClocktoabc.Clock)Note that
MockClockstill has some internal trickery related to guest mode, but it is only necessary if you want to modifyautojump_thresholdwhile the loop is running. I am not sure how to resolve that at the moment, but I'll think about it.