-
-
Notifications
You must be signed in to change notification settings - Fork 745
Closed
mswjs/interceptors
#706Labels
Description
Please avoid duplicates
- I checked all open bugs and none of them matched my problem.
Reproducible test case
https://runkit.com/jualex/6798feda0e8102000908a12a
Nock Version
14.0.0
Node Version
20.18.1
TypeScript Version
TypeScript 5.7.3
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "./dist",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"sourceMap": true,
"pretty": true,
"allowJs": false,
"strict": true,
"esModuleInterop": true,
"isolatedModules": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"types": ["jest"],
"lib": ["esnext"],
"importHelpers": true,
"resolveJsonModule": true,
"noUncheckedIndexedAccess": true
},
"include": ["src/**/*", "tests/**/*"],
"exclude": ["node_modules", "tests/cli/**/*"]
}
What happened?
After updating nock from 13.5.6 to 14.0.0, we get the following warning in our Jest tests where both nock and @testcontainers/mongodb (10.17.2) is used, every time a new MongoDBContainer
is started.
(node:10063) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 connect listeners added to [MockHttpSocket]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
Additionally, sometimes there are active handles left after the test causing the test to time out unless --forceExit
is used. It is not clear whether this is related to the warning, but it is our suspicion.
From a initial debugging session, the warning seems to come from the code where the MongoDB testcontainer uses a Unix domain socket to stream the logs of the MongoDB container to check if it has started up.
Would you be interested in contributing a fix?
- yes
schnuri-schnuri, sterlu, samchungy, ronjouch, davidm-unito and 2 more