Skip to content
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

Unable to set timeout of Pact mock service in consumer tests #298

Closed
3 of 5 tasks
TimothyJones opened this issue Jun 21, 2021 · 0 comments
Closed
3 of 5 tasks

Unable to set timeout of Pact mock service in consumer tests #298

TimothyJones opened this issue Jun 21, 2021 · 0 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@TimothyJones
Copy link
Contributor

Software versions

  • OS: All
  • Pact Node version: 10.12.2
  • Node Version: All

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
  • I have set my log level to debug and attached a log file showing the complete request/response cycle
  • For bonus points and virtual high fives, I have created a reproduceable git repository (see below) to illustrate the problem

Expected behaviour

When a timeout is given to the options in pactWith(options), the pact timeout changes.

Actual behaviour

Jest-Pact's timeout option correctly changes Jest's timeout, but does not change Pact's wait-for-service timeout.

Steps to fix

Jest-Pact doesn't pass on the actual timeout given to pact, because it's not on the options object here:

https://github.com/pact-foundation/pact-js-core/blob/master/src/service.ts#L331

It would then need to be used anywhere that PROCESS_TIMEOUT is used, eg:

https://github.com/pact-foundation/pact-js-core/blob/master/src/service.ts#L183

and

https://github.com/pact-foundation/pact-js-core/blob/master/src/service.ts#L208

Additionally, the error message Couldn't stop Pact and Couldn't start Pact would be much more helpful if they specified that there was a timeout while waiting for Pact.

@TimothyJones TimothyJones added the bug Indicates an unexpected problem or unintended behavior label Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant