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: https://github.com/nodejs/node/pull/25508 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
5d52c8e43c
commit
cdd6eb237b
@ -15,7 +15,7 @@ function runTest() {
|
|||||||
tls.createServer({
|
tls.createServer({
|
||||||
cert: fixtures.readKey('agent1-cert.pem'),
|
cert: fixtures.readKey('agent1-cert.pem'),
|
||||||
key: fixtures.readKey('agent1-key.pem'),
|
key: fixtures.readKey('agent1-key.pem'),
|
||||||
}, common.mustCall(function() {
|
}).on('connection', common.mustCall(function() {
|
||||||
this.close();
|
this.close();
|
||||||
})).listen(0, '::1', common.mustCall(function() {
|
})).listen(0, '::1', common.mustCall(function() {
|
||||||
const options = {
|
const options = {
|
||||||
@ -32,7 +32,9 @@ function runTest() {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
dns.lookup('localhost', { family: 6, all: true }, (err, addresses) => {
|
dns.lookup('localhost', {
|
||||||
|
family: 6, all: true
|
||||||
|
}, common.mustCall((err, addresses) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err.code === 'ENOTFOUND' || err.code === 'EAI_AGAIN')
|
if (err.code === 'ENOTFOUND' || err.code === 'EAI_AGAIN')
|
||||||
common.skip('localhost does not resolve to ::1');
|
common.skip('localhost does not resolve to ::1');
|
||||||
@ -44,4 +46,4 @@ dns.lookup('localhost', { family: 6, all: true }, (err, addresses) => {
|
|||||||
runTest();
|
runTest();
|
||||||
else
|
else
|
||||||
common.skip('localhost does not resolve to ::1');
|
common.skip('localhost does not resolve to ::1');
|
||||||
});
|
}));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user