Skip to content

Commit 92f803d

Browse files
committed
Ensure E2E test termination
1 parent dc5a398 commit 92f803d

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

e2e-test/mobile/local-execution-flow.test.ts

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -122,35 +122,33 @@ test("NoCode Mobile local device test execution flow", async () => {
122122
// Ensure MobileLink gets ready
123123
await delay(20_000);
124124

125-
await interactWithProcess(
126-
getAutifyCliPath(),
127-
[
128-
"mobile",
129-
"test",
130-
"run",
131-
"--build-id",
132-
BUILD_ID,
133-
"--wait",
134-
"--timeout",
135-
TIMEOUT_SECONDS.toString(),
136-
"--device-ids",
137-
simulator.udid,
138-
TEST_PLAN_URL,
139-
],
140-
[
141-
{
142-
type: "expect",
143-
regex: /Test passed!/,
144-
},
145-
]
146-
);
147-
148-
terminateStartProcess();
125+
try {
126+
await interactWithProcess(
127+
getAutifyCliPath(),
128+
[
129+
"mobile",
130+
"test",
131+
"run",
132+
"--build-id",
133+
BUILD_ID,
134+
"--wait",
135+
"--timeout",
136+
TIMEOUT_SECONDS.toString(),
137+
"--device-ids",
138+
simulator.udid,
139+
TEST_PLAN_URL,
140+
],
141+
[
142+
{
143+
type: "expect",
144+
regex: /Test passed!/,
145+
},
146+
]
147+
);
148+
} finally {
149+
terminateStartProcess();
150+
}
149151
};
150152

151-
// Test doesn't start in the TIMEOUT_SECONDS sometimes. To ensure E2E to finish in a reasonable time, we terminate
152-
// MobileLink so that the test can fail.
153-
setTimeout(terminateStartProcess, TIMEOUT_SECONDS * 1000);
154-
155153
await Promise.all([startMobileLinkResult, runTest()]);
156154
});

0 commit comments

Comments
 (0)