mirror of
https://github.com/denoland/deno.git
synced 2024-12-23 07:44:48 -05:00
chore: kill node.js tests if they run too long (#23956)
This commit is contained in:
parent
8a636d0600
commit
fab4c1776b
1 changed files with 14 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue