Commit c36d9c3d authored by Zach Pomerantz's avatar Zach Pomerantz Committed by GitHub

test: rm flaky retry test (#6431)

parent bc48b4fb
...@@ -41,26 +41,4 @@ describe('retry', () => { ...@@ -41,26 +41,4 @@ describe('retry', () => {
setTimeout(cancel, 0) setTimeout(cancel, 0)
await expect(promise).resolves.toEqual('abc') await expect(promise).resolves.toEqual('abc')
}) })
async function checkTime(fn: () => Promise<any>, min: number, max: number) {
const time = new Date().getTime()
await fn()
const diff = new Date().getTime() - time
expect(diff).toBeGreaterThanOrEqual(min)
expect(diff).toBeLessThanOrEqual(max)
}
it('waits random amount of time between min and max', async () => {
const promises = []
for (let i = 0; i < 10; i++) {
promises.push(
checkTime(
() => expect(retry(makeFn(4, 'abc'), { n: 3, maxWait: 100, minWait: 50 }).promise).rejects.toThrow('failure'),
150,
400
)
)
}
await Promise.all(promises)
})
}) })
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment