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

Fix some races in the tests #480

Merged
merged 1 commit into from
Jul 4, 2017
Merged

Fix some races in the tests #480

merged 1 commit into from
Jul 4, 2017

Commits on Jul 4, 2017

  1. Fix some races in the tests

    There is a common pattern in the tests which is, when we want to mock a /sync,
    to flush it, and then, in the next tick of the promise loop, to wait for the
    syncing event. However, this is racy: there is no guarantee that the syncing
    event will not happen before the next tick of the promise loop.
    
    Instead, we should set the expectation of the syncing event, then do the flush.
    (Technically we only need to wait for the syncing event, but by waiting for
    both we'll catch any errors thrown by the flush, and make sure we don't have
    any outstanding flushes before proceeding).
    
    Add a utility method to TestClient to do the above, and use it where we have a
    TestClient.
    
    (Also fixes a couple of other minor buglets in the tests).
    richvdh committed Jul 4, 2017
    Configuration menu
    Copy the full SHA
    ae950a2 View commit details
    Browse the repository at this point in the history