Skip to content

Commit ce00f6a

Browse files
committed
test: fix flaky keepalive timeout test on slow platforms
1 parent 408aba6 commit ce00f6a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/sequential/test-http-server-keep-alive-timeout-slow-client-headers.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ const assert = require('assert');
55
const http = require('http');
66
const net = require('net');
77

8-
const server = http.createServer(common.mustCall((req, res) => {
8+
const server = http.createServer({
9+
keepAliveTimeout: common.platformTimeout(100),
10+
keepAliveTimeoutBuffer: common.platformTimeout(1000),
11+
}, common.mustCall((req, res) => {
912
res.end();
1013
}, 2));
1114

12-
server.keepAliveTimeout = common.platformTimeout(100);
13-
1415
server.listen(0, common.mustCall(() => {
1516
const port = server.address().port;
1617
const socket = net.connect({ port }, common.mustCall(() => {

0 commit comments

Comments
 (0)