Skip to content

Commit 1e74738

Browse files
committed
test(desktop): assert the retry delays, not just their order
The backoff test compared the delay helper against itself and checked only that the second wait was longer than the first, so a 0ms/1ms backoff would have passed while retrying faster than a registry propagates. Assert the five- and twenty-second delays directly.
1 parent 8451391 commit 1e74738

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

apps/desktop/tests/stage-runtime.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ describe('deploy retries', () => {
8383
)
8484

8585
expect(retried).toEqual([1, 2])
86-
expect(waits).toEqual([deployRetryDelayMs(1), deployRetryDelayMs(2)])
86+
expect(waits).toEqual([5_000, 20_000])
8787
})
8888

8989
// A deterministic failure must still fail the build, and must surface its own
@@ -101,7 +101,11 @@ describe('deploy retries', () => {
101101
expect(waits).toHaveLength(DEPLOY_ATTEMPTS - 1)
102102
})
103103

104-
it('backs off further on the second retry', () => {
104+
// Ordering alone would accept a 0ms/1ms backoff, which retries faster than a
105+
// registry propagates and turns one retry into three failures in a row.
106+
it('waits five seconds before the first retry and twenty before the second', () => {
107+
expect(deployRetryDelayMs(1)).toBe(5_000)
108+
expect(deployRetryDelayMs(2)).toBe(20_000)
105109
expect(deployRetryDelayMs(2)).toBeGreaterThan(deployRetryDelayMs(1))
106110
})
107111
})

0 commit comments

Comments
 (0)