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

Yet more js-sdk test deflakification #499

Merged
merged 3 commits into from
Jul 17, 2017
Merged

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jul 14, 2017

Requires a version of matrix-mock-request including matrix-org/matrix-mock-request#5, so this won't build yet.

These guys do a flush("/sync"), without waiting for it to complete, and then in
the afterEach, check that the sync has been flushed, which it may not have
been. So we should make sure we wait for the flush.
Waiting for 1ms isn't actually good enough. wait for the actual thing we are
actually waiting for.
All that crypto stuff takes a while, so give it longer than 100ms.
done();

// still have a sync to flush
httpBackend.flush("/sync", 1).then(() => {
Copy link
Contributor

@lukebarnard1 lukebarnard1 Jul 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this has to flush immediately before calling done, likewise for other parts of this test

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the commit comment (adca75b): the afterEach checks it's been flushed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the afterEach should be used for that, should it not just kill the httpBackend altogether?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided (via https://riot.im/develop/#/room/#riot-dev:matrix.org/$1500047765866CodIk:sw1v.org) to leave that discussion for another day.

Copy link
Contributor

@lukebarnard1 lukebarnard1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I like all those timeouts of 1000ms :/

Update: actually timeouts are fine

@richvdh richvdh merged commit e259907 into develop Jul 17, 2017
@richvdh richvdh deleted the rav/omfg_when_will_it_end branch July 17, 2017 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants