GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: deflake test-http-agent-keepalive · nodejs/node@5fd81ba

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-http-agent-keepalive.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-http-agent-keepalive.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-agent-keepalive.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ function remoteClose() {
9494
assert.strictEqual(agent.sockets[name], undefined);
9595
assert.strictEqual(agent.freeSockets[name].length, 1);
9696
assert.strictEqual(agent.totalSocketCount, 1);
97-
// Waiting remote server close the socket
98-
setTimeout(common.mustCall(() => {
97+
// Wait for the remote server to close the socket.
98+
req.socket.once('close', common.mustCall(() => {
9999
assert.strictEqual(agent.sockets[name], undefined);
100100
assert.strictEqual(agent.freeSockets[name], undefined);
101101
assert.strictEqual(agent.totalSocketCount, 0);
102102
remoteError();
103-
}), common.platformTimeout(200));
103+
}));
104104
}));
105105
}));
106106
}));
@@ -115,13 +115,13 @@ function remoteError() {
115115
assert.strictEqual(agent.sockets[name].length, 1);
116116
assert.strictEqual(agent.freeSockets[name], undefined);
117117
assert.strictEqual(agent.totalSocketCount, 1);
118-
// Wait socket 'close' event emit
119-
setTimeout(common.mustCall(() => {
118+
// Wait for the socket's 'close' event.
119+
req.socket.once('close', common.mustCall(() => {
120120
assert.strictEqual(agent.sockets[name], undefined);
121121
assert.strictEqual(agent.freeSockets[name], undefined);
122122
assert.strictEqual(agent.totalSocketCount, 0);
123123
server.close();
124-
}), common.platformTimeout(1));
124+
}));
125125
}));
126126
}
127127

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.