Skip to content

Commit c17a37d

Browse files
sam-githubaddaleax
authored andcommitted
test: wait for TCP connect, not TLS handshake
Test assumed server gets a handshake before the client destroyed it, and didn't assert that dns.lookup() callback occurred. PR-URL: #25508 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 1f8991f commit c17a37d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/parallel/test-tls-connect-address-family.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function runTest() {
1515
tls.createServer({
1616
cert: fixtures.readKey('agent1-cert.pem'),
1717
key: fixtures.readKey('agent1-key.pem'),
18-
}, common.mustCall(function() {
18+
}).on('connection', common.mustCall(function() {
1919
this.close();
2020
})).listen(0, '::1', common.mustCall(function() {
2121
const options = {
@@ -32,7 +32,9 @@ function runTest() {
3232
}));
3333
}
3434

35-
dns.lookup('localhost', { family: 6, all: true }, (err, addresses) => {
35+
dns.lookup('localhost', {
36+
family: 6, all: true
37+
}, common.mustCall((err, addresses) => {
3638
if (err) {
3739
if (err.code === 'ENOTFOUND' || err.code === 'EAI_AGAIN')
3840
common.skip('localhost does not resolve to ::1');
@@ -44,4 +46,4 @@ dns.lookup('localhost', { family: 6, all: true }, (err, addresses) => {
4446
runTest();
4547
else
4648
common.skip('localhost does not resolve to ::1');
47-
});
49+
}));

0 commit comments

Comments
 (0)