diff options
author | Matt Mastracci <matthew@mastracci.com> | 2024-05-22 20:27:24 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-22 20:27:24 -0600 |
commit | fab4c1776b0f212f0a9f5b82842115b9b7e87d4b (patch) | |
tree | 7c7a1ec48a7b935581605aeff2f498f7096acd29 /tests/node_compat | |
parent | 8a636d0600dc7000d1e12b2fc4f4f46ecd70164a (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.ts | 15 |
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 |