Skip to content

Commit 74d54a9

Browse files
devversionalan-agius4
authored andcommitted
build: improve debugging mode of e2e test runner
Currently the `while` loop may either be causing the process to be really stuck/hanging, or it somehow causes Node to exit. This change makes the logic more robust and less CPU consuming. (cherry picked from commit fe69a9b)
1 parent 43706b3 commit 74d54a9

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tests/legacy-cli/e2e_runner.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,8 @@ Promise.all([findFreePort(), findFreePort(), findPackageTars()])
257257
console.log(`Current Directory: ${process.cwd()}`);
258258
console.log('Will loop forever while you debug... CTRL-C to quit.');
259259

260-
/* eslint-disable no-constant-condition */
261-
while (1) {
262-
// That's right!
263-
}
260+
// Wait forever until user explicitly cancels.
261+
await new Promise(() => {});
264262
}
265263

266264
process.exitCode = 1;

0 commit comments

Comments
 (0)