-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
Vitest - Pact Verifier fails with 3 or more interactions #1220
Comments
can you update your packages so pact-js pulls in pact-js-core 14.3.7 i believe this is fixed and your logs show they are running 14.3.6 |
I still observe the same errors with pact-js-core 14.3.7. |
The error is
I can resolve with this workaround, tested locally |
Glad you got to the bottom of this Yousaf! We may need to look into how we can make the core threadsafe, if possible, to enable multi-threaded tests like this (see https://github.com/nodejs/node-addon-api/blob/main/doc/threadsafe.md). For now, that workaround is good to know. |
no worries man, the reproducer was really helpful, so thanks to @shishkin It might be worth getting a basic vitest example in place, and utilise this test to reproduce our issue, document the current workaround, and it will help us test out any solutions from the linked doc. 💯 enabling multi-threaded tests would be a nice bonus rather than having to forgoe them |
Thanks @YOU54F. Indeed, running vitest with |
Thanks @shishkin. If you do feel inclined to go deep to see if we can make it multi-threaded, we'd be happy to give you some pointers (TL;DR - it'll be in here somewhere: https://github.com/pact-foundation/pact-js-core/blob/master/native/provider.cc). |
@mefellows sorry, I'm not competent in native development to dig in. |
Software versions
Issue Checklist
Please confirm the following:
Expected behaviour
It should either work or explain clearly what user did wrong.
Actual behaviour
I'm running provider tests and as long as I get 3 or more interactions in the pact file, subsequent interactions start failing due to state change handlers. Weirdly, it fails when I duplicate/copy paste interactions in the pact file, so the same interaction that just succeeded will now fail.
Steps to reproduce
See test and pact JSON.
Relevant log files
See log.
The text was updated successfully, but these errors were encountered: