1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2026-01-03 23:22:30 +03:00

Fix a bunch of races in the tests

Once we switch to bluebird, suddenly a load of timing issues come out of the
woodwork. Basically, we need to try harder when flushing requests. Bump to
matrix-mock-request 1.1.0, which provides `flushAllExpected`, and waits for
requests to arrive when given a `numToFlush`; then use `flushAllExpected` in
various places to make the tests more resilient.
This commit is contained in:
Richard van der Hoff
2017-07-11 12:09:21 +01:00
parent b2c7804032
commit 0ca4d728d8
6 changed files with 59 additions and 59 deletions

View File

@@ -133,8 +133,8 @@ function expectAliClaimKeys() {
// it can take a while to process the key query, so give it some extra
// time, and make sure the claim actually happens rather than ploughing on
// confusingly.
return aliTestClient.httpBackend.flush("/keys/claim", 1, 20).then((r) => {
expect(r).toEqual(1);
return aliTestClient.httpBackend.flush("/keys/claim", 1).then((r) => {
expect(r).toEqual(1, "Ali did not claim Bob's keys");
});
});
}