Skip to content

Commit 1380648

Browse files
committed
Fix CI
1 parent 8c7550a commit 1380648

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

test/hooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2416,7 +2416,7 @@ test('afterResponse forced retry respects totalTimeout budget', async t => {
24162416

24172417
await t.throwsAsync(
24182418
ky.get(server.url, {
2419-
totalTimeout: 100,
2419+
totalTimeout: 1000,
24202420
retry: {
24212421
limit: 3,
24222422
},
@@ -2425,7 +2425,7 @@ test('afterResponse forced retry respects totalTimeout budget', async t => {
24252425
async ({response}) => {
24262426
const data = await response.clone().json();
24272427
if (data.error?.code === 'RETRY_WITH_DELAY') {
2428-
return ky.retry({delay: 200});
2428+
return ky.retry({delay: 2000});
24292429
}
24302430
},
24312431
],

test/retry.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,20 +1329,20 @@ test('each retry gets the full per-attempt timeout (not a shared budget)', async
13291329
server.get('/', async (_request, response) => {
13301330
requestCount++;
13311331
if (requestCount === 1) {
1332-
// First attempt: consume most of a 500ms timeout, then return 500
1333-
await delay(400);
1332+
// First attempt: consume most of a 2000ms timeout, then return 500
1333+
await delay(1500);
13341334
response.sendStatus(500);
13351335
return;
13361336
}
13371337

1338-
// Second attempt: also takes 400ms, which would fail if timeout were a shared budget
1339-
// (only ~100ms would remain), but succeeds because each retry gets the full 500ms
1340-
await delay(400);
1338+
// Second attempt: also takes 1500ms, which would fail if timeout were a shared budget
1339+
// (only ~500ms would remain), but succeeds because each retry gets the full 2000ms
1340+
await delay(1500);
13411341
response.end(fixture);
13421342
});
13431343

13441344
const result = await ky(server.url, {
1345-
timeout: 500,
1345+
timeout: 2000,
13461346
retry: {
13471347
limit: 1,
13481348
delay: () => 0,

0 commit comments

Comments
 (0)