-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: move dgram invalid host test to internet tests
This moves a dgram test from `parallel` to `internet` because it relies on a DNS request. In certain cases, ISPs hijack invalid IETF-reserved invalid names which causes a false negative failure. Fixes: #27341 PR-URL: #27565 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
- Loading branch information
Showing
2 changed files
with
23 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const { addresses } = require('../common/internet'); | ||
const assert = require('assert'); | ||
const dgram = require('dgram'); | ||
|
||
const PORT = 12345; | ||
|
||
const client = dgram.createSocket('udp4'); | ||
client.connect(PORT, addresses.INVALID_HOST, common.mustCall((err) => { | ||
assert.ok(err.code === 'ENOTFOUND' || err.code === 'EAI_AGAIN'); | ||
|
||
client.once('error', common.mustCall((err) => { | ||
assert.ok(err.code === 'ENOTFOUND' || err.code === 'EAI_AGAIN'); | ||
client.once('connect', common.mustCall(() => client.close())); | ||
client.connect(PORT); | ||
})); | ||
|
||
client.connect(PORT, addresses.INVALID_HOST); | ||
})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters