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

#11679 LoopingCall vs Clock tests #11680

Merged
merged 4 commits into from Sep 22, 2022

Commits on Sep 21, 2022

  1. Change the LoopingCall tests to assert more reasonable behavior

    clock.advance(0) will run not only any calls scheduled for clock.seconds() or
    earlier, but it will also run any calls that _those_ calls schedule with
    `clock.callLater(0, ...)`.
    
    This diverges from the real IReactorTime implementations which force all
    scheduled events to wait at least one reactor iteration before they can run.
    
    This impacts the LoopingCall test cases for the case of interval == 0 because
    those tests do a lot of scheduling with `clock.callLater(0, ...)`.  In
    particular, the tests often `advance(0)` and expect a `LoopingCall` to execute
    multiple iterations.
    
    These changes make the tests advance the clock in enough discrete steps that a
    real reactor would have time to run all of the necessary calls.
    
    After twisted#5962 the old version of these tests will fail.  Also as part of twisted#5962
    one clearly-marked fudge left in these tests will need to be removed because I
    don't see how to make the test work (and remain precise) with both the broken
    Clock behavior and the real reactor behavior.
    exarkun committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    77368c6 View commit details
    Browse the repository at this point in the history
  2. news fragment

    exarkun committed Sep 21, 2022
    Configuration menu
    Copy the full SHA
    90b1572 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2022

  1. Add a clarifying comment in the test

    Co-authored-by: Adi Roiban <adiroiban@gmail.com>
    exarkun and adiroiban committed Sep 22, 2022
    Configuration menu
    Copy the full SHA
    4825f8b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8ee190c View commit details
    Browse the repository at this point in the history