Hello, I was recently using Bi-Directional testing...
# pactflow
l
Hello, I was recently using Bi-Directional testing with dredd verifier on provider side and mountebank mocks on client side. I am able to publish pact to Pactflow, however verification fails on PUT request. Precisely, I am getting status 408 and no response, but have no idea why it can be so. Screenshot shows a part where verification fails. When running API locally and executing PUT with the same parameters, everything works. My command for verification: "./pact/bin/pact-provider-verifier --provider-base-url http://localhost:3001 --provider pactflow-terms-bi-directional-provider-dredd --publish-verification-results --provider-app-version $(npx -y absolute-version -v | cut -c -7) --verbose"
đź‘‹ 1
m
If you’re using BDCT, how come you are using the pact verifier? That’s really a CDC tool (it’s OK, you can use both, but just want to understand)
408 is a Request timeout - it’s hard to know why that’s happening. Could you please set log level to DEBUG/--verbose and share the logs?
l
Here is pact log, however I do not find it helpful. I used pact verifier, because when I published my contracts from consumer, in the console I got next steps, which included verifying provider. Isn't it necessary before deploying?
m
Here is pact log, however I do not find it helpful. I used pact verifier, because when I published my contracts from consumer, in the console I got next steps, which included verifying provider. Isn’t it necessary before deploying?
absolutely! But if you’re doing BDCT you don’t need to use the Pact Verifier - you can use any API testing tool you like to ensure the OAS is valid. See https://docs.pactflow.io/docs/bi-directional-contract-testing/publishing#publishing-the-provider-contract--results-to-pactflow You can also do Pact verification testing (what you’re doing above), although usually you wouldn’t use that CLI directly, and would do it with a language client (Pact JS, Pact Ruby etc.). The CLI is there mostly for those that can’t (or don’t want to) use the client SDKs
The logs look pretty clear to me, a number of requests return
200
and others
408
. It looks like a problem with your API provider. You should look into the logs of your locally running API to understand the problem - for instance, does it need to be connected to a downstream system that’s unavailable? (hence timing out)?
l
Thanks for explaining! As for API I run it locally with nodemon, and during that verification through CLI it really took a while (probably because of problems with PUT request), and I didn't watched the terminal. But after it finished, I noticed that in a tab whre my API was running an error has shown up:
Copy code
Provider API listening on port 3001...
BadRequestError: request aborted
    at IncomingMessage.onAborted (/Users/liudmylamalomuzh/Documents/terms-provider/node_modules/raw-body/index.js:238:10)
    at IncomingMessage.emit (node:events:519:28)
    at IncomingMessage.emit (node:domain:488:12)
    at IncomingMessage._destroy (node:_http_incoming:224:10)
    at _destroy (node:internal/streams/destroy:121:10)
    at IncomingMessage.destroy (node:internal/streams/destroy:83:5)
    at abortIncoming (node:_http_server:793:9)
    at socketOnClose (node:_http_server:787:3)
    at Socket.emit (node:events:531:35)
    at Socket.emit (node:domain:488:12)
However, as I understand I can use PactJS for provider verifying?
âś… 1
m
Or you can use another tool (like Dredd) to ensure it works, and upload a provider contract instead (this is the next model)