summaryrefslogtreecommitdiff
path: root/tools/wpt/runner.ts
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2024-02-16 14:32:28 +1100
committerGitHub <noreply@github.com>2024-02-16 03:32:28 +0000
commit5596de8081970a6fa811b95e60a27dca071a714e (patch)
treec4772533f3a7b2c9945cb8f0797e4ec38fc637a9 /tools/wpt/runner.ts
parent4f80d83774ce5402a2b10503529fe422c998b841 (diff)
chore: move `test_util/wpt` to `tests/wpt/suite` (#22412)
As discussed with @mmastrac. I'll move `tools/wpt` to `tests/wpt` in a follow-up PR. --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
Diffstat (limited to 'tools/wpt/runner.ts')
-rw-r--r--tools/wpt/runner.ts14
1 files changed, 11 insertions, 3 deletions
diff --git a/tools/wpt/runner.ts b/tools/wpt/runner.ts
index 2da3a95de..ee2fc2b74 100644
--- a/tools/wpt/runner.ts
+++ b/tools/wpt/runner.ts
@@ -11,7 +11,7 @@ export async function runWithTestUtil<T>(
"wpt",
"serve",
"--config",
- "../../tools/wpt/config.json",
+ "../../../tools/wpt/config.json",
], {
stdout: verbose ? "inherit" : "piped",
stderr: verbose ? "inherit" : "piped",
@@ -31,7 +31,11 @@ export async function runWithTestUtil<T>(
}
const passedTime = performance.now() - start;
if (passedTime > 15000) {
- proc.kill("SIGINT");
+ try {
+ proc.kill("SIGINT");
+ } catch {
+ // Might have already died
+ }
await proc.status;
throw new Error("Timed out while trying to start wpt test util.");
}
@@ -43,7 +47,11 @@ export async function runWithTestUtil<T>(
return await f();
} finally {
if (verbose) console.log("Killing wpt test util.");
- proc.kill("SIGINT");
+ try {
+ proc.kill("SIGINT");
+ } catch {
+ // Might have already died
+ }
await proc.status;
}
}