From f2e18aa7d86068b7afa7ea180e0ea7f09481f796 Mon Sep 17 00:00:00 2001 From: Khafra <42794878+KhafraDev@users.noreply.github.com> Date: Sun, 16 Oct 2022 21:22:32 -0400 Subject: [PATCH] wpt: add flaky test option --- test/wpt/runner/runner/runner.mjs | 6 ++++-- test/wpt/status/fetch.status.json | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/test/wpt/runner/runner/runner.mjs b/test/wpt/runner/runner/runner.mjs index 54ce47ec388..93ad51722c2 100644 --- a/test/wpt/runner/runner/runner.mjs +++ b/test/wpt/runner/runner/runner.mjs @@ -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 @@ -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 diff --git a/test/wpt/status/fetch.status.json b/test/wpt/status/fetch.status.json index c1e4db9cccc..70d1874ae95 100644 --- a/test/wpt/status/fetch.status.json +++ b/test/wpt/status/fetch.status.json @@ -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": {