-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Make test-util paused time fully deterministic #3492
Merged
Merged
Commits on Jan 31, 2021
-
Make test-util paused time fully deterministic
The time driver stores an Instant internally used as a "base" for future time calculations. Since this is generated as the Runtime is being constructed, it previously always happened before the user had a chance to pause time. The fractional-millisecond variations in the timing around the runtime construction and time pause cause tests running entirely in paused time to be very slightly deterministic, with the time driver advancing time by 1 millisecond more or less depending on how the sub-millisecond components of the `Instant`s involved compared. To avoid this, there is now a new option on `runtime::Builder` which will create a `Runtime` with time "instantly" paused. This, along with a small change to have the time driver use the provided clock as the source for its start time allow totally deterministic tests with paused time. Closes tokio-rs#3179
Configuration menu - View commit details
-
Copy full SHA for 4aac8df - Browse repository at this point
Copy the full SHA 4aac8dfView commit details -
Configuration menu - View commit details
-
Copy full SHA for b64a572 - Browse repository at this point
Copy the full SHA b64a572View commit details -
Configuration menu - View commit details
-
Copy full SHA for 215ce30 - Browse repository at this point
Copy the full SHA 215ce30View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9524503 - Browse repository at this point
Copy the full SHA 9524503View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6cb567f - Browse repository at this point
Copy the full SHA 6cb567fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8fec76b - Browse repository at this point
Copy the full SHA 8fec76bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 86b0736 - Browse repository at this point
Copy the full SHA 86b0736View commit details -
Configuration menu - View commit details
-
Copy full SHA for 84dd3c5 - Browse repository at this point
Copy the full SHA 84dd3c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 413159c - Browse repository at this point
Copy the full SHA 413159cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a372b2 - Browse repository at this point
Copy the full SHA 6a372b2View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.