Tony Nguyen
10/17/2023, 5:03 PMOne or more of the teardown state change handlers has failed
Request Failed - One or more of the setup state change handlers has failed
Matt (pactflow.io / pact-js / pact-go)
debug
and shareTony Nguyen
10/18/2023, 3:08 PM2023-10-18T15:03:49.520839Z DEBUG ThreadId(02) verify_interaction{interaction="recommend-dataset-keys-for-elements"}: pact_verifier::provider_client: State change request failed with error error sending request for url (<http://127.0.0.1:62176/_pactSetup>): operation timed out
2023-10-18T15:03:49.521020Z DEBUG ThreadId(02) verify_interaction{interaction="recommend-dataset-keys-for-elements"}: pact_verifier: State Change: "ProviderState { name: "a recommendation can be made", params: {} }" -> Err(Provider state failed: (interaction_id: 66051c9c5088764c2d469d74f855cd957d7d4a7d) Invalid response: error sending request for url (<http://127.0.0.1:62176/_pactSetup>): operation timed out)
2023-10-18T15:03:49.521042Z ERROR ThreadId(02) verify_interaction{interaction="recommend-dataset-keys-for-elements"}: pact_verifier: Provider setup state change for 'a recommendation can be made' has failed - MismatchResult::Error("Invalid response: error sending request for url (<http://127.0.0.1:62176/_pactSetup>): operation timed out", Some("66051c9c5088764c2d469d74f855cd957d7d4a7d"))
2023-10-18T15:03:49.848428Z DEBUG ThreadId(02) pact_verifier::pact_broker: Sending JSON to /pact-version/58527d1d8bd6e127e7e92ccd2feb5450d162b8f5/metadata/c1tdW2xdPXRydWUmc1tdW2N2XT0yMTAw/verification-results using POST: {"providerApplicationVersion":"1","success":false,"testResults":[{"exceptions":[{"message":"One or more of the teardown state change handlers has failed"}],"interactionId":"382004ff8189aa179cedc852efa0e3f5f0096d44","success":false},{"exceptions":[{"message":"One or more of the setup state change handlers has failed"}],"interactionId":"10c1e72196f76471c4ad2979a9a661e57643bb5f","success":false},{"exceptions":[{"message":"One or more of the setup state change handlers has failed"}],"interactionId":"66051c9c5088764c2d469d74f855cd957d7d4a7d","success":false}],"verifiedBy":{"implementation":"Pact-Rust","version":"1.1.11"}}
Matt (pactflow.io / pact-js / pact-go)
looks like that state handler is failingCopy codea recommendation can be made
Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
Tony Nguyen
10/25/2023, 3:31 PMstateHandlers: {
"a recommendation can be made for elements": () => {
console.log('state totally handled');
return Promise.resolve();
},
},
};
Tony Nguyen
10/25/2023, 7:01 PMstateHandlers: {
"a recommendation can be made for elements": () => {
console.log('state totally handled');
return Promise.resolve({includePartialMatches: `1`});
},
},
Tony Nguyen
10/25/2023, 8:33 PMrecommend-dataset-keys-for-elements (1s loading, 456ms verification)
Given a recommendation can be made for elements
returns a response which
has status code 200 (FAILED)
includes headers
"content-type" with value "application/json" (OK)
has a matching body (FAILED)
Failures:
1) Verifying a pact between REPLACE and REPLACE Given a recommendation can be made for elements - recommend-dataset-keys-for-elements
1.1) has a matching body
$ -> Actual map is missing the following keys: datasetKeys, elements
1.2) has status code 200
expected 200 but was 400
I added a filter hoping it would fix but still nothing.
stateHandlers: {
"a recommendation can be made for elements": () => {
console.log('state totally handled');
return Promise.resolve({includePartialMatches: `1`});
},
},
requestFilter: ( req, res, next ) => {
res.statusCode = 200;
next();
}
};