From a993410d525cc6de3e205773cb706792fbf6685c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hanno=20J=2E=20G=C3=B6decke?= Date: Wed, 7 Feb 2024 14:46:15 +0100 Subject: [PATCH] e2e tests: continue when test is hanging --- tests/e2e/testRunner.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/e2e/testRunner.js b/tests/e2e/testRunner.js index 98faff32397d..63c88d207581 100644 --- a/tests/e2e/testRunner.js +++ b/tests/e2e/testRunner.js @@ -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( @@ -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'); @@ -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();