Skip to content

Commit 9b6ab03

Browse files
committed
speed up tests by lowering timeouts
1 parent e00e035 commit 9b6ab03

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/http-data-source.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ test('Should memoize subsequent GET calls to the same endpoint', async (t) => {
297297
const server = http.createServer((req, res) => {
298298
t.is(req.method, 'GET')
299299
res.write(JSON.stringify(wanted))
300-
setTimeout(() => res.end(), 200).unref()
300+
setTimeout(() => res.end(), 50).unref()
301301
res.socket?.unref()
302302
})
303303

@@ -353,7 +353,7 @@ test('Should not memoize subsequent GET calls for unsuccessful responses', async
353353
t.is(req.method, 'GET')
354354
res.writeHead(queryObject['statusCode'] as unknown as number)
355355
res.write(JSON.stringify(wanted))
356-
setTimeout(() => res.end(), 200).unref()
356+
setTimeout(() => res.end(), 50).unref()
357357
res.socket?.unref()
358358
})
359359

@@ -545,7 +545,7 @@ test.cb('Should abort request when abortController signal is called', (t) => {
545545
res.writeHead(200)
546546
res.end()
547547
res.socket?.unref()
548-
}, 500)
548+
}, 50)
549549
})
550550
.unref()
551551

@@ -601,7 +601,7 @@ test.cb('Should timeout because server does not respond fast enough', (t) => {
601601
res.writeHead(200)
602602
res.end()
603603
res.socket?.unref()
604-
}, 500)
604+
}, 100)
605605
})
606606
.unref()
607607

@@ -615,8 +615,8 @@ test.cb('Should timeout because server does not respond fast enough', (t) => {
615615
constructor() {
616616
super(baseURL, {
617617
clientOptions: {
618-
bodyTimeout: 100,
619-
headersTimeout: 100,
618+
bodyTimeout: 50,
619+
headersTimeout: 50,
620620
},
621621
})
622622
}

0 commit comments

Comments
 (0)