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 e585a11

Browse filesBrowse files
batrlatargos
authored andcommitted
test: fix test-net-connect-reset-until-connected
Fixes: #43446 PR-URL: #46781 Reviewed-By: theanarkh <theratliter@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent f21ed3a commit e585a11
Copy full SHA for e585a11

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

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

‎test/parallel/parallel.status‎

Copy file name to clipboardExpand all lines: test/parallel/parallel.status
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ test-crypto-dh-stateless: SKIP
3131
test-crypto-keygen: SKIP
3232

3333
[$system==solaris] # Also applies to SmartOS
34-
# https://github.com/nodejs/node/issues/43446
35-
test-net-connect-reset-until-connected: PASS, FLAKY
3634
# https://github.com/nodejs/node/issues/43457
3735
test-domain-no-error-handler-abort-on-uncaught-0: PASS, FLAKY
3836
test-domain-no-error-handler-abort-on-uncaught-1: PASS,FLAKY
@@ -52,8 +50,6 @@ test-domain-with-abort-on-uncaught-exception: PASS, FLAKY
5250
test-fs-stat-bigint: PASS,FLAKY
5351
# https://github.com/nodejs/node/issues/31280
5452
test-worker-message-port-message-before-close: PASS,FLAKY
55-
# https://github.com/nodejs/node/issues/43446
56-
test-net-connect-reset-until-connected: PASS, FLAKY
5753

5854
[$system==ibmi]
5955
# https://github.com/nodejs/node/pull/30819
Collapse file

‎test/parallel/test-net-connect-reset-until-connected.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-net-connect-reset-until-connected.js
+10-1Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,27 @@
33
const common = require('../common');
44
const net = require('net');
55

6+
function barrier(count, cb) {
7+
return function() {
8+
if (--count === 0)
9+
cb();
10+
};
11+
}
12+
613
const server = net.createServer();
714
server.listen(0, common.mustCall(function() {
815
const port = server.address().port;
916
const conn = net.createConnection(port);
17+
const connok = barrier(2, () => conn.resetAndDestroy());
1018
conn.on('close', common.mustCall());
1119
server.on('connection', (socket) => {
20+
connok();
1221
socket.on('error', common.expectsError({
1322
code: 'ECONNRESET',
1423
message: 'read ECONNRESET',
1524
name: 'Error'
1625
}));
1726
server.close();
1827
});
19-
conn.resetAndDestroy();
28+
conn.on('connect', connok);
2029
}));

0 commit comments

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