mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -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,
|
...envVars,
|
||||||
},
|
},
|
||||||
cwd,
|
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();
|
const { code, stdout, stderr } = await command.output();
|
||||||
|
clearTimeout(warner);
|
||||||
|
clearTimeout(killer);
|
||||||
|
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
// If the test case failed, show the stdout, stderr, and instruction
|
// If the test case failed, show the stdout, stderr, and instruction
|
||||||
|
|
Loading…
Reference in a new issue