Closed qmg-rbass closed 6 months ago
Thank you for raising it and for the repro, is has reproduced the error for me also.
@rholshausen I'll move this to the core project as it looks to be in the core.
Moving this back to pact-js, it is a Node issue.
Looks like process.stdout._handle.setBlocking(true)
before calling the FFI methods resolves the issue.
Nice find - thanks Ron!
Thanks. I face this issue only when the number of tests in the suite is around 20+, the suites with less number of tests does not have this issue. Is there any workaround I can use temporarily, please ?
@santhosh-r-urs I added the following workaround to my test suite (thanks for the hint @rholshausen)
const setBlockingOutput = (blocking : boolean) => {
if (process.stdout._handle) {
process.stdout._handle.setBlocking(blocking)
}
}
beforeAll(() => {
setBlockingOutput(true)
});
afterAll(() => {
setBlockingOutput(false)
});
Thanks @qmg-rbass . The workaround worked perfect for my suite too !
Fix released in 14.3.7
of pact-js-core
https://github.com/pact-foundation/pact-js-core/releases/tag/v14.3.7
Failing run of repro, pre release Passing run of repro post release
Software versions
Issue Checklist
Please confirm the following:
Expected behaviour
Pact verification is successful.
Actual behaviour
Pact verification is unsuccessful with error:
Steps to reproduce
Minimal example below, instructions in README:
https://github.com/qmg-rbass/pact-bug-2
Looks to me like it is caused by having a large number of messages to verify. This minimal example uses 128 dummy messages in the same pact file. But we see the same error in a real project with ~45 different messages, spread across several files on a pact broker.
The minimal example fails every time. In the case of the real project it is based on, we interestingly see the error ~80% of the time, with verification eventually successful after multiple retries.
Relevant log files