-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
Conversation
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(() => { |
There was a problem hiding this 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 why this has to flush immediately before calling done
, likewise for other parts of this test
There was a problem hiding this comment.
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.
There was a problem hiding this 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 the afterEach
should be used for that, should it not just kill the httpBackend altogether?
There was a problem hiding this comment.
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.
There was a problem hiding this 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
Requires a version of matrix-mock-request including matrix-org/matrix-mock-request#5, so this won't build yet.