Skip to content

Commit

Permalink
add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
pepoviola committed Mar 3, 2025
1 parent 5f198c7 commit 85657e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion javascript/packages/orchestrator/src/test-runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ export async function run(
});

suite.afterAll("teardown", async function () {
const timeout = 180 * 1000; // 3 mins
this.timeout(timeout + 10 * 1000); // just in case use mocha timeout after 10 secs of the teardown timeout.
const innerTearDown = async () => {
// report metric
const testEnd = performance.now();
Expand Down Expand Up @@ -234,7 +236,6 @@ export async function run(
if (inCI) await registerTotalElapsedTimeSecs(elapsedSecs, success);
};

const timeout = 180 * 1000; // 3 mins
const resp = await Promise.race([
innerTearDown(),
new Promise((resolve) =>
Expand All @@ -246,6 +247,7 @@ export async function run(
}, timeout),
),
]);
console.log(resp);
if (resp instanceof Error) {
console.log(`${decorators.yellow("⚠️ Error in teardown process!")}`);
console.log(`err: ${resp}`);
Expand Down

0 comments on commit 85657e7

Please sign in to comment.