Skip to content

Commit

Permalink
test(internal-plugin-dss): revert test and fix with an empty catch (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mkesavan13 authored Apr 25, 2024
1 parent d5e0804 commit 5984fbc
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions packages/@webex/internal-plugin-dss/test/unit/spec/dss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,22 +241,24 @@ describe('plugin-dss', () => {
expect(result).to.be.null;
});
it('fails with default timeout when mercury does not respond', async () => {
return testMakeRequest({
const {promise} = await testMakeRequest({
method: 'lookupDetail',
resource: '/lookup/orgid/userOrgId/identity/test id/detail',
params: {id: 'test id'},
bodyParams: {},
}).then(async ({promise}) => {
promise.catch((err) => {
expect(err.toString()).equal(
'DssTimeoutError: The DSS did not respond within 6000 ms.' +
'\n Request Id: randomid' +
'\n Resource: /lookup/orgid/userOrgId/identity/test id/detail' +
'\n Params: undefined'
);
});
await clock.tickAsync(6000);
});

promise.catch(() => {}); // to prevent the test from failing due to unhandled promise rejection

await clock.tickAsync(6000);

return assert.isRejected(
promise,
'The DSS did not respond within 6000 ms.' +
'\n Request Id: randomid' +
'\n Resource: /lookup/orgid/userOrgId/identity/test id/detail' +
'\n Params: undefined'
);
});

it('does not fail with timeout when mercury response in time', async () => {
Expand Down Expand Up @@ -1155,7 +1157,7 @@ describe('plugin-dss', () => {
expect(Batcher.prototype.request.getCall(1).args).to.deep.equal(['id2']);
expect(result).to.equal(response2);
});
// TODO
// TODO - https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-518037
it.skip('fails fails when mercury does not respond, later batches can still pass ok', async () => {
// Batch 1
const {
Expand Down

0 comments on commit 5984fbc

Please sign in to comment.