Skip to content

Commit

Permalink
Merge pull request #36025 from margelo/fix/don-t-fail-execution-on-ti…
Browse files Browse the repository at this point in the history
…meout

[NoQA] e2e tests: continue when test is hanging
  • Loading branch information
mountiny authored Feb 8, 2024
2 parents 19ca917 + a993410 commit b483b3f
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/e2e/testRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,16 @@ const runTests = async () => {
mockNetwork: true,
});

const onError = (e) => {
testLog.done();
if (i === 0) {
// If the error happened on the first test run, the test is broken
// and we should not continue running it
throw e;
}
console.error(e);
};

// Wait for a test to finish by waiting on its done call to the http server
try {
await withFailTimeout(
Expand All @@ -352,9 +362,7 @@ const runTests = async () => {
progressText,
);
} catch (e) {
// When we fail due to a timeout it's interesting to take a screenshot of the emulator to see whats going on
testLog.done();
throw e; // Rethrow to abort execution
onError(e);
}

Logger.log('Killing main app');
Expand All @@ -378,9 +386,7 @@ const runTests = async () => {
progressText,
);
} catch (e) {
// When we fail due to a timeout it's interesting to take a screenshot of the emulator to see whats going on
testLog.done();
throw e; // Rethrow to abort execution
onError(e);
}
}
testLog.done();
Expand Down

0 comments on commit b483b3f

Please sign in to comment.