Skip to content

Commit 6104c68

Browse files
authored
Fix flaky Installations test (#2490)
1 parent af162f9 commit 6104c68

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

packages/installations/src/helpers/get-installation-entry.test.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,19 @@ describe('getInstallationEntry', () => {
354354
const { registrationPromise } = await installationEntryPromise;
355355

356356
// Let the new getInstallationEntry process start.
357-
await sleep(10);
357+
await sleep(50);
358358

359-
expect(await get(appConfig)).to.deep.equal({
359+
const tokenDetails = (await get(
360+
appConfig
361+
)) as InProgressInstallationEntry;
362+
expect(tokenDetails.registrationTime).to.be.at.least(
363+
/* When the first pending request failed. */ 1_001_500
364+
);
365+
expect(tokenDetails).to.deep.equal({
360366
fid: FID,
361367
registrationStatus: RequestStatus.IN_PROGRESS,
362-
registrationTime: 1_001_500 // Started when the first pending request failed.
368+
// Ignore registrationTime as we already checked it.
369+
registrationTime: tokenDetails.registrationTime
363370
});
364371

365372
expect(registrationPromise).to.be.an.instanceOf(Promise);
@@ -384,7 +391,7 @@ describe('getInstallationEntry', () => {
384391
const { registrationPromise } = await installationEntryPromise;
385392

386393
// Let the new getInstallationEntry process start.
387-
await sleep(10);
394+
await sleep(50);
388395

389396
expect(await get(appConfig)).to.deep.equal({
390397
fid: FID,

0 commit comments

Comments
 (0)