Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 20c032e

Browse filesBrowse files
mcollinaaduh95
authored andcommitted
test: resolve race condition in test-net-write-fully-async-*
Signed-off-by: Matteo Collina <hello@matteocollina.com> PR-URL: #57022 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 3d103ec commit 20c032e
Copy full SHA for 20c032e

File tree

Expand file treeCollapse file tree

2 files changed

+5
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-net-write-fully-async-buffer.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-net-write-fully-async-buffer.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ const data = Buffer.alloc(1000000);
1111

1212
const server = net.createServer(common.mustCall(function(conn) {
1313
conn.resume();
14+
server.close();
1415
})).listen(0, common.mustCall(function() {
1516
const conn = net.createConnection(this.address().port, common.mustCall(() => {
1617
let count = 0;
1718

1819
function writeLoop() {
19-
if (count++ === 200) {
20-
conn.destroy();
21-
server.close();
20+
if (count++ === 20) {
21+
conn.end();
2222
return;
2323
}
2424

Collapse file

‎test/parallel/test-net-write-fully-async-hex-string.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-net-write-fully-async-hex-string.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ const data = Buffer.alloc(1000000).toString('hex');
99

1010
const server = net.createServer(common.mustCall(function(conn) {
1111
conn.resume();
12+
server.close();
1213
})).listen(0, common.mustCall(function() {
1314
const conn = net.createConnection(this.address().port, common.mustCall(() => {
1415
let count = 0;
1516

1617
function writeLoop() {
1718
if (count++ === 20) {
18-
conn.destroy();
19-
server.close();
19+
conn.end();
2020
return;
2121
}
2222

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.