-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
create-websocket-stream.test.js fails if the domain module is loaded #2124
Comments
To reproduce you can put |
This seems to fix the issue: diff --git a/test/create-websocket-stream.test.js b/test/create-websocket-stream.test.js
index 4d51958..ab61ebe 100644
--- a/test/create-websocket-stream.test.js
+++ b/test/create-websocket-stream.test.js
@@ -285,7 +285,7 @@ describe('createWebSocketStream', () => {
});
});
- it("does not suppress the throwing behavior of 'error' events", (done) => {
+ it.skip("does not suppress the throwing behavior of 'error' events", (done) => {
const wss = new WebSocket.Server({ port: 0 }, () => {
const ws = new WebSocket(`ws://localhost:${wss.address().port}`);
createWebSocketStream(ws);
I did not investigate but I think it is related to the |
mvduin
added a commit
to dutchanddutch/node-ws
that referenced
this issue
Mar 9, 2023
Fix a failure in test/create-websocket-stream.test.js if the node:domain module is loaded (e.g. due to NODE_OPTIONS in environment). The cause of the failure was that installing an 'uncaughtException' event handler on process will cause node:domain to prepend its own handler for the same event, which confused the test. Fixes: websockets#2124
lpinca
pushed a commit
that referenced
this issue
Mar 9, 2023
Fix a failure in `test/create-websocket-stream.test.js` if the domain module is loaded (e.g. due to `NODE_OPTIONS` in environment). The cause of the failure was that installing an `'uncaughtException'` event handler on `process` causes the domain module to prepend its own handler for the same event, which confused the test. Fixes #2124
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there an existing issue for this?
Description
If the
domain
module is loaded whentest/create-websocket-stream.test.js
executes, it has some bizarre failures (see below). Other tests do not have this porblem.I ran into this problem because I have
NODE_OPTIONS="-r /home/matthijs/.node_defaults.js"
in my environment to load a script that tweaks some REPL behaviour, for which I have to requirerepl
which then requiresdomain
.While an argument could be made that it's impolite to have an environment that causes
domain
to be loaded into every node script, it's concerning for it to be causing test failures since that may imply actual bugs whenws
is used in an environment that hasdomain
loaded (e.g. whenever you're testing something from the REPL).ws version
8.12.1
Node.js Version
14.21.3, 16.19.1, 18.14.2
System
No response
Expected result
No response
Actual result
No response
Attachments
Test output:
The text was updated successfully, but these errors were encountered: