Skip to content

Commit 904b8f3

Browse files
KhafraDevpanva
andauthored
exit with 1 if WPT runner has unexpected errors (nodejs#2621)
* exit with 1 if WPT runner has unexpected errors * fixup * fixup * fixup * Update test/wpt/runner/runner.mjs Co-authored-by: Filip Skokan <panva.ip@gmail.com> --------- Co-authored-by: Filip Skokan <panva.ip@gmail.com>
1 parent 05797a5 commit 904b8f3

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

test/wpt/runner/runner.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export class WPTRunner extends EventEmitter {
313313
`skipped: ${skipped}`
314314
)
315315

316-
process.exit(0)
316+
process.exit(failed - expectedFailures ? 1 : process.exitCode)
317317
}
318318

319319
addInitScript (code) {

test/wpt/runner/worker.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { WebSocket } from '../../../lib/websocket/websocket.js'
1212
import { Cache } from '../../../lib/cache/cache.js'
1313
import { CacheStorage } from '../../../lib/cache/cachestorage.js'
1414
import { kConstruct } from '../../../lib/cache/symbols.js'
15+
import { webcrypto } from 'node:crypto'
1516

1617
const { initScripts, meta, test, url, path } = workerData
1718

@@ -92,6 +93,14 @@ Object.defineProperties(globalThis, {
9293
}
9394
})
9495

96+
// TODO: remove once node 18 is dropped
97+
if (!globalThis.crypto) {
98+
Object.defineProperty(globalThis, 'crypto', {
99+
...globalPropertyDescriptors,
100+
value: webcrypto
101+
})
102+
}
103+
95104
// self is required by testharness
96105
// GLOBAL is required by self
97106
runInThisContext(`

test/wpt/status/fetch.status.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,14 @@
9292
"skip": true
9393
},
9494
"scheme-blob.sub.any.js": {
95-
"note": "fails everywhere",
95+
"note": "fail: fails everywhere, flaky: only node 18",
9696
"fail": [
9797
"Fetching URL.createObjectURL(invalid_type_blob) is OK"
98+
],
99+
"flaky": [
100+
"Fetching URL.createObjectURL(empty_blob) is OK",
101+
"Fetching URL.createObjectURL(empty_type_blob) is OK",
102+
"Fetching URL.createObjectURL(empty_data_blob) is OK"
98103
]
99104
},
100105
"status.h2.any.js": {
@@ -417,6 +422,12 @@
417422
"note": "this is a bug in webstreams, see https://github.com/nodejs/node/issues/46786",
418423
"skip": true
419424
}
425+
},
426+
"idlharness.any.js": {
427+
"note": "https://github.com/nodejs/undici/issues/1666#issuecomment-1275177704",
428+
"fail": [
429+
"Window interface: operation fetch(RequestInfo, optional RequestInit)"
430+
]
420431
}
421432
},
422433
"content-length": {

0 commit comments

Comments
 (0)