Lukasz Wlosek
06/06/2022, 2:41 PMpact-node@10.17.2: Starting pact binary '/home/repos/gf-accounts-service/node_modules/@pact-foundation/pact-node/standalone/linux-x64-1.88.83/pact/bin/pact-provider-verifier', with arguments [--provider-states-setup-url <http://localhost:46091/_pactSetup> --provider-base-url <http://localhost:46091> --provider-app-version dc04a08
The ports for --provider-states-setup-url and --provider-base-url seem to be failing my TeamCity build sometimes, as some of these ports are reserved, I thought that specifying the providerBaseUrl in the provider settings sets these ports, in my case it was http://localhost:3000/ but it seems like the pact-provider-verifier spins this up with different ports as some proxy? Is there a way to specify which port to use in that pact-provider-verifier script?Matt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
…seem to be failing my TeamCity build sometimes, as some of these ports are reservedthe ports should be selected by the OS as available, so this seems unlikely to me. Can you share the setup that’s failing? Flakey tests are usually a sign of mishandled promises or timeouts (on CI machines often are slower than your high powered dev machine)
Lukasz Wlosek
06/07/2022, 9:51 AMconst stateHandlers = {
'has a account saved': async () => {
// connect to local db and add/seed account data
await seedTable();
return Promise.resolve(
'Accounts added: 9ae9b264-f181-46ea-a468-4919c48fbe0(1-5)'
);
}
};
When changing to
const stateHandlers = {
'has a account saved': () => {
// connect to local db and add/seed account data
return Promise.resolve(seedTable());
}
};
worked, so this means stateHandlers when changing to async would not work, is this intended?Matt (pactflow.io / pact-js / pact-go)
async
should workMatt (pactflow.io / pact-js / pact-go)
seedTable()
a promise/async fn?
This does not wait for it to complete, if so.
return Promise.resolve(seedTable());
My guess is that the test is timing out and seedTable
is taking longer than the test timeoutLukasz Wlosek
06/07/2022, 10:13 AMconst seedTable = async () => {
const account = Account.make({
PK: 'A_' + '9ae9b264-f181-46ea-a468-4919c48fbe01',
SK: 'V0_' + Account.RECORD_TYPE,
emailAddress: '<mailto:random@email.com|random@email.com>',
groupHash: '123',
siteIdentifier: 'ss',
idpId: 'random',
loginCount: 0,
loginHistory: []
});
await account.save();
const accountTwo = Account.make({
PK: 'A_' + '9ae9b264-f181-46ea-a468-4919c48fbe02',
SK: 'V0_' + Account.RECORD_TYPE,
emailAddress: '<mailto:random@email.com|random@email.com>',
groupHash: '123',
siteIdentifier: 'ss',
idpId: 'random',
loginCount: 0,
loginHistory: []
});
await accountTwo.save();
}
and I have jest.setTimeout(9000000); so that should be enough time right