You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello old friend 👋 Struggling to say for sure if this a user error or if I’ve stumbled upon an edge case.
I’m writing tests in jest, mocking globally, using node 18, and node native fetch.
Scenario:
First test is for retrying after AbortSignal.timeout expires (no errors from this running on its own)
Following test makes a second fetch and an error is logged
node:internal/webstreams/readablestream:323
new ERR_INVALID_STATE.TypeError('ReadableStream is locked'));
^
TypeError: Invalid state: ReadableStream is locked
at ReadableStream.cancel (node:internal/webstreams/readablestream:323:9)
at AbortSignal.abort (/Users/Laurie.Boyes/dev/fetch-mock/packages/core/dist/cjs/Router.js:95:47)
at AbortSignal.[nodejs.internal.kHybridDispatch] (node:internal/event_target:816:20)
at AbortSignal.dispatchEvent (node:internal/event_target:751:26)
at abortSignal (node:internal/abort_controller:374:10)
at Timeout._onTimeout (node:internal/abort_controller:128:7)
at listOnTimeout (node:internal/timers:573:17)
at processTimers (node:internal/timers:514:7) {
code: 'ERR_INVALID_STATE'
}
Please see the test case in this PR: #844. Let me know if there’s any other info I can provide.
I've been working around this issue by explicitly creating an AbortController and setting a timeout to fire the signal and manually cancelling it after the promise resolves
The text was updated successfully, but these errors were encountered:
Which version of jest are you on? I'm not able to get the test to fail, but I do keep getting flaky tests relating to abort in CI which have been around for ages and I'm not too sure why
Hello old friend 👋 Struggling to say for sure if this a user error or if I’ve stumbled upon an edge case.
I’m writing tests in jest, mocking globally, using node 18, and node native fetch.
Scenario:
Please see the test case in this PR: #844. Let me know if there’s any other info I can provide.
I've been working around this issue by explicitly creating an AbortController and setting a timeout to fire the signal and manually cancelling it after the promise resolves
The text was updated successfully, but these errors were encountered: