Skip to content

Commit

Permalink
Merge pull request #1044 from chromaui/cody/cap-2182-node-srctasksver…
Browse files Browse the repository at this point in the history
…ifytestts-verifybuild-times-out-if-build

Fix flaky verify timeout test
  • Loading branch information
codykaup authored Sep 12, 2024
2 parents 0c9674a + e2fe5d1 commit 68338db
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions node-src/tasks/verify.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,20 +102,15 @@ describe('verifyBuild', () => {
});

it('times out if build takes too long to start', async () => {
const build = {
status: 'IN_PROGRESS',
const publishedBuild = {
status: 'PUBLISHED',
features: { uiTests: true, uiReview: false },
app: {},
startedAt: Date.now(),
startedAt: null,
upgradeBuilds: [],
};
const publishedBuild = { ...build, status: 'PUBLISHED', startedAt: null, upgradeBuilds: [] };
const client = { runQuery: vi.fn() };
client.runQuery
// Polling four times is going to hit the timeout
.mockReturnValueOnce({ app: { build: publishedBuild } })
.mockReturnValueOnce({ app: { build: publishedBuild } })
.mockReturnValueOnce({ app: { build: publishedBuild } })
.mockReturnValue({ app: { build } });
client.runQuery.mockReturnValue({ app: { build: publishedBuild } });

const ctx = { client, ...defaultContext } as any;
await expect(verifyBuild(ctx, {} as any)).rejects.toThrow('Build verification timed out');
Expand Down

0 comments on commit 68338db

Please sign in to comment.