mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 15:24:46 -05:00
This reverts commit 5fcbdd6228
.
This commit is contained in:
parent
ddc350780d
commit
93a712fbac
2 changed files with 2 additions and 16 deletions
|
@ -1087,8 +1087,8 @@
|
|||
"EventTarget-constructible.any.html": true,
|
||||
"EventTarget-constructible.any.worker.html": true,
|
||||
"Event-constructors.any.html": [
|
||||
"Event constructors 3",
|
||||
"Event constructors 4"
|
||||
"Untitled 3",
|
||||
"Untitled 4"
|
||||
],
|
||||
"Event-constructors.any.worker.html": [
|
||||
"Event constructors 3",
|
||||
|
|
|
@ -76,15 +76,12 @@ export async function runSingleTest(
|
|||
reporter: (result: TestCaseResult) => void,
|
||||
inspectBrk: boolean,
|
||||
): Promise<TestResult> {
|
||||
const timeout = _options.timeout === "long" ? 60_000 : 20_000;
|
||||
const { title } = Object.fromEntries(_options.script_metadata || []);
|
||||
const bundle = await generateBundle(url);
|
||||
const tempFile = await Deno.makeTempFile({
|
||||
prefix: "wpt-bundle-",
|
||||
suffix: ".js",
|
||||
});
|
||||
|
||||
let interval;
|
||||
try {
|
||||
await Deno.writeTextFile(tempFile, bundle);
|
||||
|
||||
|
@ -110,7 +107,6 @@ export async function runSingleTest(
|
|||
"[]",
|
||||
);
|
||||
|
||||
const start = performance.now();
|
||||
const proc = new Deno.Command(denoBinary(), {
|
||||
args,
|
||||
env: {
|
||||
|
@ -128,19 +124,10 @@ export async function runSingleTest(
|
|||
const lines = proc.stderr.pipeThrough(new TextDecoderStream()).pipeThrough(
|
||||
new TextLineStream(),
|
||||
);
|
||||
interval = setInterval(() => {
|
||||
const passedTime = performance.now() - start;
|
||||
if (passedTime > timeout) {
|
||||
proc.kill("SIGINT");
|
||||
}
|
||||
}, 1000);
|
||||
for await (const line of lines) {
|
||||
if (line.startsWith("{")) {
|
||||
const data = JSON.parse(line);
|
||||
const result = { ...data, passed: data.status == 0 };
|
||||
if (title && /^Untitled( \d+)?$/.test(result.name)) {
|
||||
result.name = `${title}${result.name.slice(8)}`;
|
||||
}
|
||||
cases.push(result);
|
||||
reporter(result);
|
||||
} else if (line.startsWith("#$#$#{")) {
|
||||
|
@ -162,7 +149,6 @@ export async function runSingleTest(
|
|||
stderr,
|
||||
};
|
||||
} finally {
|
||||
clearInterval(interval);
|
||||
await Deno.remove(tempFile);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue