Fix race condition, error reporting

This commit is contained in:
Radon Rosborough 2020-07-30 08:47:46 -06:00
parent 0945ad6550
commit 80119ba66d
3 changed files with 3 additions and 2 deletions

View File

@ -72,7 +72,6 @@ export class Session {
this.lang = lang;
this.logPrimitive = log;
this.log(`Creating session, language ${this.lang}`);
this.setup();
}
run = async (args: string[], options?: Options) => {

View File

@ -78,7 +78,7 @@ function addWebsocket(
);
ws.close();
} else {
new api.Session(ws, lang, console.log);
new api.Session(ws, lang, console.log).setup();
}
});
return app;

View File

@ -75,6 +75,7 @@ class Test {
this.timedOut = true;
this.handleUpdate();
}, TIMEOUT_MS);
await session.setup();
switch (this.type) {
case "ensure":
await this.testEnsure();
@ -273,6 +274,7 @@ async function main() {
} catch (err) {
console.error("failed:");
console.error(test.getLog());
console.error(err);
}
}
}