Add some logging to track down flaky test
We had a test failure where apparently the MatrixClient failed to start ... let's try and figure out why.
This commit is contained in:
parent
769752e0b3
commit
a20ed2f632
2 changed files with 14 additions and 8 deletions
|
@ -77,22 +77,26 @@ class MatrixClientPeg {
|
|||
this._createClient(creds);
|
||||
}
|
||||
|
||||
start() {
|
||||
async start() {
|
||||
const opts = utils.deepCopy(this.opts);
|
||||
// the react sdk doesn't work without this, so don't allow
|
||||
opts.pendingEventOrdering = "detached";
|
||||
|
||||
let promise = this.matrixClient.store.startup();
|
||||
// log any errors when starting up the database (if one exists)
|
||||
promise.catch((err) => {
|
||||
try {
|
||||
let promise = this.matrixClient.store.startup();
|
||||
console.log(`MatrixClientPeg: waiting for MatrixClient store to initialise`);
|
||||
await promise;
|
||||
} catch(err) {
|
||||
// log any errors when starting up the database (if one exists)
|
||||
console.error(`Error starting matrixclient store: ${err}`);
|
||||
});
|
||||
}
|
||||
|
||||
// regardless of errors, start the client. If we did error out, we'll
|
||||
// just end up doing a full initial /sync.
|
||||
promise.finally(() => {
|
||||
this.get().startClient(opts);
|
||||
});
|
||||
|
||||
console.log(`MatrixClientPeg: really starting MatrixClient`);
|
||||
this.get().startClient(opts);
|
||||
console.log(`MatrixClientPeg: MatrixClient started`);
|
||||
}
|
||||
|
||||
getCredentials(): MatrixClientCreds {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue