summaryrefslogtreecommitdiff
path: root/tests/node_compat
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-05-22 20:27:24 -0600
committerGitHub <noreply@github.com>2024-05-22 20:27:24 -0600
commitfab4c1776b0f212f0a9f5b82842115b9b7e87d4b (patch)
tree7c7a1ec48a7b935581605aeff2f498f7096acd29 /tests/node_compat
parent8a636d0600dc7000d1e12b2fc4f4f46ecd70164a (diff)
chore: kill node.js tests if they run too long (#23956)
Diffstat (limited to 'tests/node_compat')
-rw-r--r--tests/node_compat/test.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/node_compat/test.ts b/tests/node_compat/test.ts
index 2f690e943..db4ba4f52 100644
--- a/tests/node_compat/test.ts
+++ b/tests/node_compat/test.ts
@@ -104,8 +104,21 @@ async function runTest(t: Deno.TestContext, path: string): Promise<void> {
...envVars,
},
cwd,
- });
+ stdout: "piped",
+ stderr: "piped",
+ }).spawn();
+ const warner = setTimeout(() => {
+ console.error(`Test is running slow: ${testCase}`);
+ }, 2 * 60_000);
+ const killer = setTimeout(() => {
+ console.error(
+ `Test ran far too long, terminating with extreme prejudice: ${testCase}`,
+ );
+ command.kill();
+ }, 10 * 60_000);
const { code, stdout, stderr } = await command.output();
+ clearTimeout(warner);
+ clearTimeout(killer);
if (code !== 0) {
// If the test case failed, show the stdout, stderr, and instruction