question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fetch: wpt tests that are failing

See original GitHub issue

We 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:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
KhafraDevcommented, Oct 13, 2022

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:

const [out1, out2] = stream.tee()

const cloned = structuredClone(out2, { transfer: [out2] })
0reactions
KhafraDevcommented, Oct 13, 2022

I will experiment with it, but none of my initial attempts got anywhere

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found