Skip to content

Commit 02e871a

Browse files
committed
ci: delay first app check
1 parent d1bf4f4 commit 02e871a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

test-app/tools/try_to_find_test_result_file.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ function execAndStream(command, streamOutput = false) {
3434

3535
function parseLogcatTimestamp(line) {
3636
// Logcat format: "MM-DD HH:mm:ss.mmm"
37-
const timeMatch = line.match(/(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})\.(\d{3})/);
37+
const timeMatch = line.match(
38+
/(\d{2})-(\d{2})\s+(\d{2}):(\d{2}):(\d{2})\.(\d{3})/
39+
);
3840
if (!timeMatch) return null;
3941

4042
const month = parseInt(timeMatch[1], 10) - 1; // JavaScript months are 0-indexed
@@ -131,7 +133,11 @@ async function pollForResults() {
131133
setTimeout(pollForResults, pollIntervalMs);
132134
}
133135

134-
function main() {
136+
function delay(ms) {
137+
return new Promise((resolve) => setTimeout(resolve, ms));
138+
}
139+
140+
async function main() {
135141
setTimeout(() => {
136142
timedOut = true;
137143
}, processTimeoutMs);
@@ -141,6 +147,7 @@ function main() {
141147
runOnDeviceOrEmulator || "default device"
142148
}...`
143149
);
150+
await delay(10000); // Initial delay to allow app startup
144151
pollForResults().catch((err) => {
145152
console.error("Unexpected failure while waiting for results", err);
146153
process.exit(1);

0 commit comments

Comments
 (0)