You've already forked matrix-js-sdk
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:
@@ -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");
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user