Skip to content
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 10 commits into from
Feb 5, 2021

Commits on Jan 31, 2021

  1. 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
    sfackler committed Jan 31, 2021
    Configuration menu
    Copy the full SHA
    4aac8df View commit details
    Browse the repository at this point in the history
  2. fix doctest

    sfackler committed Jan 31, 2021
    Configuration menu
    Copy the full SHA
    b64a572 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    215ce30 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9524503 View commit details
    Browse the repository at this point in the history
  5. fix tests

    sfackler committed Jan 31, 2021
    Configuration menu
    Copy the full SHA
    6cb567f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8fec76b View commit details
    Browse the repository at this point in the history
  7. fix import ambiguity

    sfackler committed Jan 31, 2021
    Configuration menu
    Copy the full SHA
    86b0736 View commit details
    Browse the repository at this point in the history
  8. feedback

    sfackler committed Jan 31, 2021
    Configuration menu
    Copy the full SHA
    84dd3c5 View commit details
    Browse the repository at this point in the history
  9. update UI tests

    sfackler committed Jan 31, 2021
    Configuration menu
    Copy the full SHA
    413159c View commit details
    Browse the repository at this point in the history
  10. fix test

    sfackler committed Jan 31, 2021
    Configuration menu
    Copy the full SHA
    6a372b2 View commit details
    Browse the repository at this point in the history