Skip to content

Commit

Permalink
add catch for dumpLogs and stop network in teardown (#1878)
Browse files Browse the repository at this point in the history
* add catch for dumpLogs and stop network in teardown

* lint
  • Loading branch information
pepoviola authored Sep 25, 2024
1 parent e9f0993 commit 7e1c711
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions javascript/packages/orchestrator/src/test-runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,14 @@ export async function run(
debug(`\t 🕰 [Test] elapsed time: ${elapsedSecs} secs`);
if (inCI) await registerTotalElapsedTimeSecs(elapsedSecs);

const logsPath = await network.dumpLogs(false);
let logsPath;
try {
logsPath = await network.dumpLogs(false);
} catch (e) {
console.log(`${decorators.red("❌ Error dumping logs!")}`);
console.log(`err: ${e}`);
}

const tests = this.test?.parent?.tests;

if (tests) {
Expand All @@ -154,7 +161,12 @@ export async function run(

// All test passed, just remove the network
console.log(`\n\t ${decorators.green("Deleting network")}`);
await network.stop();
try {
await network.stop();
} catch (e) {
console.log(`${decorators.yellow("⚠️ Error deleting network")}`);
console.log(`err: ${e}`);
}

// show logs
console.log(
Expand Down

0 comments on commit 7e1c711

Please sign in to comment.