<#1021 Very slow cleanup with PactV3, something ha...
# pact-js-development
g
#1021 Very slow cleanup with PactV3, something happening on the ffi side Issue created by algardas-sca Software versionsOS: Ubuntu 22.04 • Consumer Pact library: pact-js 10.4.0 • Provider Pact library:
{"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
Copy code
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")
})
Copy code
>>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-js
t
@Matt (pactflow.io / pact-js / pact-go) - this sounds like what I experienced with the tests on master- they would hang at the end for about 30 seconds
🤔 1