Skip to content

Commit

Permalink
fix: proper handle a case, when app is totally unusable and always cr…
Browse files Browse the repository at this point in the history
…ashes
  • Loading branch information
kirillzyusko committed Oct 24, 2024
1 parent 473ebc5 commit c5782b5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tests/e2e/testRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const runTests = async (): Promise<void> => {
await launchApp('android', appPackage, config.ACTIVITY_PATH, launchArgs);

const {promise, resetTimeout} = withFailTimeout(
new Promise<void>((resolve) => {
new Promise<void>((resolve, reject) => {
const removeListener = server.addTestDoneListener(() => {
Logger.success(iterationText);

Expand Down Expand Up @@ -215,9 +215,14 @@ const runTests = async (): Promise<void> => {
removeListener();
// something went wrong, let's wait a little bit and try again
await sleep(5000);
// simply restart the test
await runTestIteration(appPackage, iterationText, branch, launchArgs);
resolve();
try {
// simply restart the test
await runTestIteration(appPackage, iterationText, branch, launchArgs);
resolve();
} catch (e) {
// okay, give up and throw the exception further
reject(e);
}
},
});
}),
Expand Down

0 comments on commit c5782b5

Please sign in to comment.