Skip to content

Commit f2e18aa

Browse files
KhafraDevronag
authored andcommitted
wpt: add flaky test option
1 parent 2533d76 commit f2e18aa

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

test/wpt/runner/runner/runner.mjs

+4-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class WPTRunner extends EventEmitter {
124124
* Called after a test has succeeded or failed.
125125
*/
126126
handleIndividualTestCompletion (message, fileName) {
127-
const { fail, allowUnexpectedFailures } = this.#status[fileName] ?? {}
127+
const { fail, allowUnexpectedFailures, flaky } = this.#status[fileName] ?? {}
128128

129129
if (message.type === 'result') {
130130
this.#stats.completed += 1
@@ -134,7 +134,9 @@ export class WPTRunner extends EventEmitter {
134134

135135
const name = normalizeName(message.result.name)
136136

137-
if (allowUnexpectedFailures || fail?.includes(name)) {
137+
if (flaky?.includes(name)) {
138+
this.#stats.expectedFailures += 1
139+
} else if (allowUnexpectedFailures || fail?.includes(name)) {
138140
this.#stats.expectedFailures += 1
139141
} else {
140142
process.exitCode = 1

test/wpt/status/fetch.status.json

+4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
"response.headers.get('double-trouble') expects , ",
6262
"response.headers.get('foo-test') expects 1, 2, 3",
6363
"response.headers.get('heya') expects , \\x0B\f, 1, , , 2"
64+
],
65+
"flaky": [
66+
"response.headers.get('content-length') expects 0",
67+
"response.headers.get('www-authenticate') expects 1, 2, 3, 4"
6468
]
6569
},
6670
"integrity.sub.any.js": {

0 commit comments

Comments
 (0)