From 53fd1016a7f074b765d5a5c90db877c851e63768 Mon Sep 17 00:00:00 2001 From: tsctx <91457664+tsctx@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:56:48 +0000 Subject: [PATCH 1/3] Fix several WPT failures --- test/wpt/server/server.mjs | 25 +++++++-- test/wpt/server/websocket.mjs | 1 + test/wpt/status/fetch.status.json | 73 ++++++++------------------ test/wpt/status/websockets.status.json | 4 ++ 4 files changed, 47 insertions(+), 56 deletions(-) diff --git a/test/wpt/server/server.mjs b/test/wpt/server/server.mjs index a83651d38ac..8f516a1843b 100644 --- a/test/wpt/server/server.mjs +++ b/test/wpt/server/server.mjs @@ -43,10 +43,17 @@ const server = createServer({ joinDuplicateHeaders: true }, async (req, res) => res.setHeader('content-type', 'text/html') // fall through } - case '/fetch/content-encoding/resources/big.text.gz': + case '/fetch/content-encoding/gzip/resources/big.text.gz': + case '/fetch/content-encoding/gzip/resources/foo.octetstream.gz': + case '/fetch/content-encoding/gzip/resources/foo.text.gz': + case '/fetch/content-encoding/br/resources/big.text.br': + case '/fetch/content-encoding/br/resources/foo.octetstream.br': + case '/fetch/content-encoding/br/resources/foo.text.br': + case '/fetch/content-encoding/zstd/resources/big.window.zst': + case '/fetch/content-encoding/zstd/resources/big.text.zst': + case '/fetch/content-encoding/zstd/resources/foo.octetstream.zst': + case '/fetch/content-encoding/zstd/resources/foo.text.zst': case '/service-workers/cache-storage/resources/simple.txt': - case '/fetch/content-encoding/resources/foo.octetstream.gz': - case '/fetch/content-encoding/resources/foo.text.gz': case '/fetch/api/resources/cors-top.txt': case '/fetch/api/resources/top.txt': case '/mimesniff/mime-types/resources/generated-mime-types.json': @@ -327,11 +334,21 @@ const server = createServer({ joinDuplicateHeaders: true }, async (req, res) => break } - case '/fetch/content-encoding/resources/bad-gzip-body.py': { + case '/fetch/content-encoding/gzip/resources/bad-gzip-body.py': { res.setHeader('Content-Encoding', 'gzip') res.end('not actually gzip') break } + case '/fetch/content-encoding/br/resources/bad-br-body.py': { + res.setHeader('Content-Encoding', 'br') + res.end('not actually br') + break + } + case '/fetch/content-encoding/zstd/resources/bad-zstd-body.py': { + res.setHeader('Content-Encoding', 'br') + res.end('not actually br') + break + } case '/fetch/api/resources/dump-authorization-header.py': { res.setHeader('Content-Type', 'text/html') res.setHeader('Cache-Control', 'no-cache') diff --git a/test/wpt/server/websocket.mjs b/test/wpt/server/websocket.mjs index 6f91e1e5131..9776766bd62 100644 --- a/test/wpt/server/websocket.mjs +++ b/test/wpt/server/websocket.mjs @@ -7,6 +7,7 @@ import { server } from './server.mjs' // event, so I'm unsure if we can stop relying on server. const wss = new WebSocketServer({ + maxPayload: 1024 * 1024 * 1024, noServer: true, handleProtocols: (protocols) => protocols.values().next().value }) diff --git a/test/wpt/status/fetch.status.json b/test/wpt/status/fetch.status.json index 2557207bc88..da1ca4cd337 100644 --- a/test/wpt/status/fetch.status.json +++ b/test/wpt/status/fetch.status.json @@ -389,16 +389,6 @@ "Consume empty FormData response body as text" ] }, - "response-consume-stream.any.js": { - "note": "only fail in node v18", - "flaky": [ - "Read blob response's body as readableStream with mode=byob", - "Read text response's body as readableStream with mode=byob", - "Read URLSearchParams response's body as readableStream with mode=byob", - "Read array buffer response's body as readableStream with mode=byob", - "Read form data response's body as readableStream with mode=byob" - ] - }, "response-stream-with-broken-then.any.js": { "note": "this is a bug in webstreams, see https://github.com/nodejs/node/issues/46786", "skip": true @@ -412,56 +402,35 @@ } }, "content-encoding": { - "br": { - "bad-br-body.https.any.js": { - "note": "TODO(@KhafraDev): investigate failure", - "fail": [ - "Consuming the body of a resource with bad br content with arrayBuffer() should reject" - ] - }, - "big-br-body.https.any.js": { - "note": "TODO(@KhafraDev): investigate failure", - "fail": [ - "large br data should be decompressed successfully", - "large br data should be decompressed successfully with byte stream" + "zstd": { + "note": "Node.js v23.8.0+ and v22.15.0+", + "bad-zstd-body.https.any.js": { + "flaky": [ + "Consuming the body of a resource with bad zstd content with arrayBuffer() should reject", + "Consuming the body of a resource with bad zstd content with blob() should reject", + "Consuming the body of a resource with bad zstd content with bytes() should reject", + "Consuming the body of a resource with bad zstd content with formData() should reject", + "Consuming the body of a resource with bad zstd content with json() should reject", + "Consuming the body of a resource with bad zstd content with text() should reject" ] }, - "br-body.https.any.js": { - "note": "TODO(@KhafraDev): investigate failure", - "fail": [ - "fetched br data with content type text should be decompressed.", - "fetched br data with content type octetstream should be decompressed." - ] - } - }, - "gzip": { - "bad-gzip-body.any.js": { - "note": "TODO(@KhafraDev): investigate failure", - "fail": [ - "Consuming the body of a resource with bad gzip content with arrayBuffer() should reject", - "Consuming the body of a resource with bad gzip content with blob() should reject", - "Consuming the body of a resource with bad gzip content with json() should reject", - "Consuming the body of a resource with bad gzip content with text() should reject" + "big-window-zstd-body.tentative.https.any.js": { + "flaky": [ + "Consuming the body of a resource with too large of a zstd window size should reject" ] }, - "gzip-body.any.js": { - "note": "TODO(@KhafraDev): investigate failure", - "fail": [ - "fetched gzip data with content type text should be decompressed.", - "fetched gzip data with content type octetstream should be decompressed." + "big-zstd-body.https.any.js": { + "flaky": [ + "large zstd data should be decompressed successfully", + "large zstd data should be decompressed successfully with byte stream" ] }, - "big-gzip-body.https.any.js": { - "note": "TODO(@KhafraDev): investigate failure", - "fail": [ - "large gzip data should be decompressed successfully", - "large gzip data should be decompressed successfully with byte stream" + "zstd-body.https.any.js": { + "flaky": [ + "fetched zstd data with content type text should be decompressed.", + "fetched zstd data with content type octetstream should be decompressed." ] } - }, - "zstd": { - "note": "node does not have zstd yet", - "skip": true } }, "content-length": { diff --git a/test/wpt/status/websockets.status.json b/test/wpt/status/websockets.status.json index 920501e0d4c..c2ffcdf9715 100644 --- a/test/wpt/status/websockets.status.json +++ b/test/wpt/status/websockets.status.json @@ -18,6 +18,10 @@ "flaky": [ "abort during handshake should work" ] + }, + "write.any.js": { + "note": "TODO: investigate failure", + "skip": true } } }, From 69adcc9bb445fe3404b9473e5e601ec6cdaa6c76 Mon Sep 17 00:00:00 2001 From: tsctx <91457664+tsctx@users.noreply.github.com> Date: Wed, 4 Jun 2025 12:58:57 +0000 Subject: [PATCH 2/3] fixup --- test/wpt/server/server.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/wpt/server/server.mjs b/test/wpt/server/server.mjs index 8f516a1843b..e0bb44b534a 100644 --- a/test/wpt/server/server.mjs +++ b/test/wpt/server/server.mjs @@ -345,8 +345,8 @@ const server = createServer({ joinDuplicateHeaders: true }, async (req, res) => break } case '/fetch/content-encoding/zstd/resources/bad-zstd-body.py': { - res.setHeader('Content-Encoding', 'br') - res.end('not actually br') + res.setHeader('Content-Encoding', 'zstd') + res.end('not actually zstd') break } case '/fetch/api/resources/dump-authorization-header.py': { From 09ef3ebc5c5941a4620275c0f7dd7ca242539a91 Mon Sep 17 00:00:00 2001 From: tsctx <91457664+tsctx@users.noreply.github.com> Date: Wed, 4 Jun 2025 13:05:48 +0000 Subject: [PATCH 3/3] fixup --- test/wpt/status/fetch.status.json | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/test/wpt/status/fetch.status.json b/test/wpt/status/fetch.status.json index da1ca4cd337..209ec9ce713 100644 --- a/test/wpt/status/fetch.status.json +++ b/test/wpt/status/fetch.status.json @@ -403,34 +403,8 @@ }, "content-encoding": { "zstd": { - "note": "Node.js v23.8.0+ and v22.15.0+", - "bad-zstd-body.https.any.js": { - "flaky": [ - "Consuming the body of a resource with bad zstd content with arrayBuffer() should reject", - "Consuming the body of a resource with bad zstd content with blob() should reject", - "Consuming the body of a resource with bad zstd content with bytes() should reject", - "Consuming the body of a resource with bad zstd content with formData() should reject", - "Consuming the body of a resource with bad zstd content with json() should reject", - "Consuming the body of a resource with bad zstd content with text() should reject" - ] - }, - "big-window-zstd-body.tentative.https.any.js": { - "flaky": [ - "Consuming the body of a resource with too large of a zstd window size should reject" - ] - }, - "big-zstd-body.https.any.js": { - "flaky": [ - "large zstd data should be decompressed successfully", - "large zstd data should be decompressed successfully with byte stream" - ] - }, - "zstd-body.https.any.js": { - "flaky": [ - "fetched zstd data with content type text should be decompressed.", - "fetched zstd data with content type octetstream should be decompressed." - ] - } + "note": "Node.js v23.8.0+ and v22.15.0+ (but older version 'Segmentation fault')", + "skip": true } }, "content-length": {