fetch: wpt tests that are failing
See original GitHub issueWe check if signal is aborted here: https://github.com/nodejs/undici/blob/9c3f34c97dfce7f7f6cffd04b7d4dab9921dc40d/lib/fetch/index.js#L126 and the promise gets rejected here: https://github.com/nodejs/undici/blob/9c3f34c97dfce7f7f6cffd04b7d4dab9921dc40d/lib/fetch/index.js#L304
import { fetch, setGlobalOrigin } from 'undici'
import assert from 'assert'
setGlobalOrigin('http://localhost:3000')
const controller = new AbortController();
const signal = controller.signal;
controller.abort();
const log = [];
await Promise.all([
fetch('../resources/data.json', { signal }).then(
() => assert_unreached("Fetch must not resolve"),
() => log.push('fetch-reject')
),
Promise.resolve().then(() => log.push('next-microtask'))
]);
assert.deepStrictEqual(log, ['fetch-reject', 'next-microtask']);
_Originally posted by @KhafraDev in https://github.com/nodejs/undici/issues/1664#issuecomment-1256836575_
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Tests failed because of the difference between DNS and `/etc ...
Several tests for testing the fetch method with trailing dot failed due to /etc/hosts setting issues and should work with actual DNS lookup....
Read more >1014676 - Failure in external/wpt/service-workers ... - Monorail
I made some investigation, this issue is caused by when dispatching the sub-resource fetch event to SW, it doesn't check whether the SW...
Read more >1596092 - [wpt-sync] Sync PR 20230 - Fix failing Fetch Metadata WPT
Sync web-platform-tests PR 20230 into mozilla-central (this bug is closed when the sync is complete). PR: https://github.com/web-platform-tests/wpt ...
Read more >170713 – Refresh WPT tests up to ... - WebKit Bugzilla
... http://webkit-queues.webkit.org/results/4597002 New failing tests: imported/w3c/web-platform-tests/fetch/api/abort/serviceworker-intercepted.https.html ...
Read more >web-platform-tests dashboard - WPT.FYI
wpt /fetch/private-network-access. For information on the search syntax, view the search documentation. Press <Enter> to commit query.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Will be fixed by #1697
~~https://github.com/web-platform-tests/wpt/blob/master/fetch/api/response/response-clone.any.js~~
These tests are mostly/all failing due to us not cloning the tee’d ReadableStream from response.clone()A fix would look like:I will experiment with it, but none of my initial attempts got anywhere