Skip to content

Commit

Permalink
fix(coverage): make coverage runtime timeout stable (#7953)
Browse files Browse the repository at this point in the history
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
Boshen and autofix-ci[bot] authored Dec 17, 2024
1 parent a4e8ce8 commit 99a431b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 28 deletions.
54 changes: 27 additions & 27 deletions tasks/coverage/snapshots/runtime.snap
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ tasks/coverage/test262/test/language/expressions/async-generator/named-yield-sta
transform error: Test262Error: Expected SameValue"get throw"», «"get next"») to be true

tasks/coverage/test262/test/language/expressions/async-generator/named-yield-star-next-call-done-get-abrupt.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/async-generator/named-yield-star-next-call-returns-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -109,7 +109,7 @@ tasks/coverage/test262/test/language/expressions/async-generator/named-yield-sta
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true

tasks/coverage/test262/test/language/expressions/async-generator/named-yield-star-next-non-object-ignores-then.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/async-generator/named-yield-star-next-then-get-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -130,7 +130,7 @@ tasks/coverage/test262/test/language/expressions/async-generator/yield-star-asyn
transform error: Test262Error: Expected SameValue"get throw"», «"get next"») to be true

tasks/coverage/test262/test/language/expressions/async-generator/yield-star-next-call-done-get-abrupt.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/async-generator/yield-star-next-call-returns-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -139,7 +139,7 @@ tasks/coverage/test262/test/language/expressions/async-generator/yield-star-next
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true

tasks/coverage/test262/test/language/expressions/async-generator/yield-star-next-non-object-ignores-then.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/async-generator/yield-star-next-then-get-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -163,7 +163,7 @@ tasks/coverage/test262/test/language/expressions/class/async-gen-method/yield-st
transform error: Test262Error: Expected SameValue(«"get throw"», «"get next"») to be true

tasks/coverage/test262/test/language/expressions/class/async-gen-method/yield-star-next-call-done-get-abrupt.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/class/async-gen-method/yield-star-next-call-returns-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -172,7 +172,7 @@ tasks/coverage/test262/test/language/expressions/class/async-gen-method/yield-st
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true

tasks/coverage/test262/test/language/expressions/class/async-gen-method/yield-star-next-non-object-ignores-then.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/class/async-gen-method/yield-star-next-then-get-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -193,7 +193,7 @@ tasks/coverage/test262/test/language/expressions/class/async-gen-method-static/y
transform error: Test262Error: Expected SameValue(«"get throw"», «"get next"») to be true

tasks/coverage/test262/test/language/expressions/class/async-gen-method-static/yield-star-next-call-done-get-abrupt.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/class/async-gen-method-static/yield-star-next-call-returns-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -202,7 +202,7 @@ tasks/coverage/test262/test/language/expressions/class/async-gen-method-static/y
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true

tasks/coverage/test262/test/language/expressions/class/async-gen-method-static/yield-star-next-non-object-ignores-then.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/class/async-gen-method-static/yield-star-next-then-get-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand Down Expand Up @@ -241,7 +241,7 @@ tasks/coverage/test262/test/language/expressions/class/elements/async-gen-privat
transform error: Test262Error: Expected SameValue(«"get throw"», «"get next"») to be true

tasks/coverage/test262/test/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-done-get-abrupt.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/class/elements/async-gen-private-method/yield-star-next-call-returns-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -250,7 +250,7 @@ tasks/coverage/test262/test/language/expressions/class/elements/async-gen-privat
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true

tasks/coverage/test262/test/language/expressions/class/elements/async-gen-private-method/yield-star-next-non-object-ignores-then.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/class/elements/async-gen-private-method/yield-star-next-then-get-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -271,7 +271,7 @@ tasks/coverage/test262/test/language/expressions/class/elements/async-gen-privat
transform error: Test262Error: Expected SameValue(«"get throw"», «"get next"») to be true

tasks/coverage/test262/test/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-done-get-abrupt.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-call-returns-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -280,7 +280,7 @@ tasks/coverage/test262/test/language/expressions/class/elements/async-gen-privat
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true

tasks/coverage/test262/test/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-non-object-ignores-then.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/class/elements/async-gen-private-method-static/yield-star-next-then-get-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand Down Expand Up @@ -313,7 +313,7 @@ tasks/coverage/test262/test/language/expressions/object/method-definition/async-
transform error: Test262Error: Expected SameValue(«"get throw"», «"get next"») to be true

tasks/coverage/test262/test/language/expressions/object/method-definition/async-gen-yield-star-next-call-done-get-abrupt.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/object/method-definition/async-gen-yield-star-next-call-returns-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -322,7 +322,7 @@ tasks/coverage/test262/test/language/expressions/object/method-definition/async-
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true

tasks/coverage/test262/test/language/expressions/object/method-definition/async-gen-yield-star-next-non-object-ignores-then.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/expressions/object/method-definition/async-gen-yield-star-next-then-get-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand Down Expand Up @@ -388,7 +388,7 @@ tasks/coverage/test262/test/language/statements/async-generator/yield-star-async
transform error: Test262Error: Expected SameValue(«"get throw"», «"get next"») to be true

tasks/coverage/test262/test/language/statements/async-generator/yield-star-next-call-done-get-abrupt.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/statements/async-generator/yield-star-next-call-returns-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -397,7 +397,7 @@ tasks/coverage/test262/test/language/statements/async-generator/yield-star-next-
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true

tasks/coverage/test262/test/language/statements/async-generator/yield-star-next-non-object-ignores-then.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/statements/async-generator/yield-star-next-then-get-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -406,13 +406,13 @@ tasks/coverage/test262/test/language/statements/async-generator/yield-star-next-
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true

tasks/coverage/test262/test/language/statements/async-generator/yield-star-normal-notdone-iter-value-throws.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/statements/async-generator/yield-star-promise-not-unwrapped.js
transform error: Test262Error: .throw should not be accessed

tasks/coverage/test262/test/language/statements/async-generator/yield-star-return-notdone-iter-value-throws.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/statements/async-generator/yield-star-return-then-getter-ticks.js
transform error: Test262Error: Actual [start, get return, tick 1, get then, tick 2, tick 3] and expected [start, tick 1, get then, tick 2, get return, get then, tick 3] should have the same contents. Ticks for return with thenable getter
Expand All @@ -421,7 +421,7 @@ tasks/coverage/test262/test/language/statements/async-generator/yield-star-sync-
transform error: throw-arg-1

tasks/coverage/test262/test/language/statements/async-generator/yield-star-throw-notdone-iter-value-throws.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/statements/class/async-gen-method/yield-star-async-next.js
transform error: Test262Error: Expected SameValue(«"get next done (1)"», «"get next value (1)"») to be true
Expand All @@ -433,7 +433,7 @@ tasks/coverage/test262/test/language/statements/class/async-gen-method/yield-sta
transform error: Test262Error: Expected SameValue(«"get throw"», «"get next"») to be true

tasks/coverage/test262/test/language/statements/class/async-gen-method/yield-star-next-call-done-get-abrupt.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/statements/class/async-gen-method/yield-star-next-call-returns-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -442,7 +442,7 @@ tasks/coverage/test262/test/language/statements/class/async-gen-method/yield-sta
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true

tasks/coverage/test262/test/language/statements/class/async-gen-method/yield-star-next-non-object-ignores-then.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/statements/class/async-gen-method/yield-star-next-then-get-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -463,7 +463,7 @@ tasks/coverage/test262/test/language/statements/class/async-gen-method-static/yi
transform error: Test262Error: Expected SameValue(«"get throw"», «"get next"») to be true

tasks/coverage/test262/test/language/statements/class/async-gen-method-static/yield-star-next-call-done-get-abrupt.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/statements/class/async-gen-method-static/yield-star-next-call-returns-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -472,7 +472,7 @@ tasks/coverage/test262/test/language/statements/class/async-gen-method-static/yi
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true

tasks/coverage/test262/test/language/statements/class/async-gen-method-static/yield-star-next-non-object-ignores-then.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/statements/class/async-gen-method-static/yield-star-next-then-get-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand Down Expand Up @@ -514,7 +514,7 @@ tasks/coverage/test262/test/language/statements/class/elements/async-gen-private
transform error: Test262Error: Expected SameValue(«"get throw"», «"get next"») to be true

tasks/coverage/test262/test/language/statements/class/elements/async-gen-private-method/yield-star-next-call-done-get-abrupt.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/statements/class/elements/async-gen-private-method/yield-star-next-call-returns-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -523,7 +523,7 @@ tasks/coverage/test262/test/language/statements/class/elements/async-gen-private
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true

tasks/coverage/test262/test/language/statements/class/elements/async-gen-private-method/yield-star-next-non-object-ignores-then.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/statements/class/elements/async-gen-private-method/yield-star-next-then-get-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -544,7 +544,7 @@ tasks/coverage/test262/test/language/statements/class/elements/async-gen-private
transform error: Test262Error: Expected SameValue(«"get throw"», «"get next"») to be true

tasks/coverage/test262/test/language/statements/class/elements/async-gen-private-method-static/yield-star-next-call-done-get-abrupt.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/statements/class/elements/async-gen-private-method-static/yield-star-next-call-returns-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand All @@ -553,7 +553,7 @@ tasks/coverage/test262/test/language/statements/class/elements/async-gen-private
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true

tasks/coverage/test262/test/language/statements/class/elements/async-gen-private-method-static/yield-star-next-non-object-ignores-then.js
transform error: http://localhost:32055/run: Network Error: Unexpected EOF
transform error: Timed out.

tasks/coverage/test262/test/language/statements/class/elements/async-gen-private-method-static/yield-star-next-then-get-abrupt.js
transform error: Test262Error: reject reason Expected SameValueTypeError: The iterator does not provide a 'throw' method.», «[object Object]») to be true
Expand Down
9 changes: 8 additions & 1 deletion tasks/coverage/src/runtime/runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,14 @@ const server = createServer((req, res) => {
req.on('end', async () => {
const options = JSON.parse(body);
try {
await runCodeInHarness(options);
await Promise.race([
runCodeInHarness(options),
// The error is caught by `process.on('unhandledRejection'` at the bottom of this script.
// Log the error there and use `--filter file` to see what's thrown.
new Promise((_resolve, reject) => {
setTimeout(() => reject('Timed out.'), 1000);
}),
]);
} catch (err) {
if (parseInt(process.version.split('.')[0].replace('v', '')) < 22) {
return res.end('Please upgrade the Node.js version to 22 or later.');
Expand Down

0 comments on commit 99a431b

Please sign in to comment.