GitHub
12/09/2022, 2:06 PM{"pactRust": Object {"ffi": String("0.3.15")}}
• Node Version: 18.12.1
Issue Checklist
Please confirm the following:
• [*] I have upgraded to the latest
• [*] I have the read the FAQs in the Readme
• [*] I have triple checked, that there are no unhandled promises in my code and have read the section on intermittent test failures
• [*] I have set my log level to debug and attached a log file showing the complete request/response cycle
Expected behaviour
Cleanup after a few new PactV3(...)
calls is fast.
Actual behaviour
Cleanup is very slow.
Steps to reproduce
const { PactV3 } = require("@pact-foundation/pact")
const providers = []
for (let i = 0, len = 20; i < len; i++) {
const provider = new PactV3({
consumer: 'MyConsumer',
provider: 'MyProvider',
logLevel: 'debug',
})
providers.push(provider)
}
console.log(Date.now(), 'DONE')
process.on('exit', function() {
console.log(Date.now(), "EXIT")
})
>>node test-pact.js; date +%s
1670594674361 DONE
(node:18241) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
1670594675207 EXIT
1670594682
7s doing cleanup?
Of course this is a contrived example because the provider is not used, but I see the same when running a full test.
pact-foundation/pact-jsTimothy Jones
12/10/2022, 12:31 PM