Skip to content

Commit

Permalink
wpt: add flaky test option
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev authored and ronag committed Oct 17, 2022
1 parent 2533d76 commit f2e18aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/wpt/runner/runner/runner.mjs
Expand Up @@ -124,7 +124,7 @@ export class WPTRunner extends EventEmitter {
* Called after a test has succeeded or failed.
*/
handleIndividualTestCompletion (message, fileName) {
const { fail, allowUnexpectedFailures } = this.#status[fileName] ?? {}
const { fail, allowUnexpectedFailures, flaky } = this.#status[fileName] ?? {}

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

const name = normalizeName(message.result.name)

if (allowUnexpectedFailures || fail?.includes(name)) {
if (flaky?.includes(name)) {
this.#stats.expectedFailures += 1
} else if (allowUnexpectedFailures || fail?.includes(name)) {
this.#stats.expectedFailures += 1
} else {
process.exitCode = 1
Expand Down
4 changes: 4 additions & 0 deletions test/wpt/status/fetch.status.json
Expand Up @@ -61,6 +61,10 @@
"response.headers.get('double-trouble') expects , ",
"response.headers.get('foo-test') expects 1, 2, 3",
"response.headers.get('heya') expects , \\x0B\f, 1, , , 2"
],
"flaky": [
"response.headers.get('content-length') expects 0",
"response.headers.get('www-authenticate') expects 1, 2, 3, 4"
]
},
"integrity.sub.any.js": {
Expand Down

0 comments on commit f2e18aa

Please sign in to comment.