-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NODE_V8_COVERAGE
leads to different behavior, dispatcher.on is not a function
#2328
Comments
NODE_V8_COVERAGE
leads to different behaviorNODE_V8_COVERAGE
leads to different behavior, dispatcher.on is not a function
I created issue in I don't know why this issue transfer from Quote @KhafraDev
const SUGGESTION_A = "undici.addSignal(signal)";
const SUGGESTION_B = "undici.removeSignal(signal)";
if (dispatcher.on) {
dispatcher.on("disconnect", () => {
this.finalizer(key);
if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {
}
this.finalizer(key);
});
} else {
// https://github.com/nodejs/node/issues/49344
if (registedSignal.get(signal)) {
console.debug(`should call ${SUGGESTION_B} after fetch`)
} else {
throw new Error(
`should call ${SUGGESTION_A} before fetch, and call ${SUGGESTION_B} after fetch`
);
}
} |
Right, it seems to me that this issue was caused by #2298, which is a workaround for a bug in Node.js. Maybe it's not such a good idea to fix this issue, which was introduced by a workaround, with yet another workaround. I don't have time to come up with a reproduction, but it feels like #2330 would probably break stuff in unexpected ways. These failures will be hard to track down as well, since they depend on the execution environment, and not only the code. Please do not branch the execution based on whether coverage is enabled or not.
Well, you are importing from the |
Thanks for the link. Now, I understand the situation.
|
Version
v20.8.0
Platform
Docker ArchLinux 6.1.55-1-lts
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior? Why is that the expected behavior?
NODE_V8_COVERAGE
does not leads to different behavior.$ node reproduce.mjs $ $ env NODE_V8_COVERAGE='./coverage/tmp' node ./reproduce.mjs $
What do you see instead?
NODE_V8_COVERAGE
leads to different behavior.$ node reproduce.mjs $ $ env NODE_V8_COVERAGE='./coverage/tmp' node ./reproduce.mjs /tmp/tmp.UqQMFN5Qmf/node_modules/undici/index.js:110 Error.captureStackTrace(err, this) ^ TypeError: dispatcher.on is not a function at fetch (/tmp/tmp.UqQMFN5Qmf/node_modules/undici/index.js:110:15) at async file:///tmp/tmp.UqQMFN5Qmf/reproduce.mjs:5:1 Node.js v20.8.0
Additional information
No response
The text was updated successfully, but these errors were encountered: