Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v8.8.1 proposal #16498

Merged
merged 15 commits into from
Oct 25, 2017
Merged
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ release.
</tr>
<tr>
<td valign="top">
<b><a href="doc/changelogs/CHANGELOG_V8.md#8.8.0">8.8.0</a></b><br/>
<b><a href="doc/changelogs/CHANGELOG_V8.md#8.8.1">8.8.1</a></b><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.8.0">8.8.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.7.0">8.7.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.6.0">8.6.0</a><br/>
<a href="doc/changelogs/CHANGELOG_V8.md#8.5.0">8.5.0</a><br/>
Expand Down
13 changes: 8 additions & 5 deletions COLLABORATOR_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ understand the project governance model as outlined in

## Issues and Pull Requests

Courtesy should always be shown to individuals submitting issues and
pull requests to the Node.js project.
Courtesy should **always** be shown to individuals submitting issues and pull
requests to the Node.js project. Be welcoming to first time contributors,
identified by the GitHub ![badge](./doc/first_timer_badge.png) badge.

Collaborators should feel free to take full responsibility for
managing issues and pull requests they feel qualified to handle, as
Expand Down Expand Up @@ -68,6 +69,9 @@ wide-reaching impact), and focused changes that affect only documentation
and/or the test suite, may be landed after a shorter delay if they have
multiple approvals.

For first time contributors, ask the author if they have configured their git
username and email to their liking as per [this guide][git-username].

For non-breaking changes, if there is no disagreement amongst
Collaborators, a pull request may be landed given appropriate review.
Where there is discussion amongst Collaborators, consensus should be
Expand Down Expand Up @@ -362,10 +366,8 @@ The TSC should serve as the final arbiter where required.
* If you do, please force-push removing the merge.
* Reasons for not using the web interface button:
* The merge method will add an unnecessary merge commit.
* The rebase & merge method adds metadata to the commit title.
* The rebase method changes the author.
* The squash & merge method has been known to add metadata to the
commit title.
commit title (the PR #).
* If more than one author has contributed to the PR, keep the most recent
author when squashing.

Expand Down Expand Up @@ -675,3 +677,4 @@ LTS working group and the Release team.
[backporting guide]: doc/guides/backporting-to-release-lines.md
[Stability Index]: doc/api/documentation.md#stability-index
[Enhancement Proposal]: https://github.com/nodejs/node-eps
[git-username]: https://help.github.com/articles/setting-your-username-in-git/
3 changes: 0 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -854,11 +854,8 @@ By making a contribution to this project, I certify that:
[Building guide]: ./BUILDING.md
[CI (Continuous Integration) test run]: #ci-testing
[Code of Conduct]: https://github.com/nodejs/TSC/blob/master/CODE_OF_CONDUCT.md
[guide for writing tests in Node.js]: ./doc/guides/writing-tests.md
[https://ci.nodejs.org/]: https://ci.nodejs.org/
[IRC in the #node-dev channel]: https://webchat.freenode.net?channels=node-dev&uio=d4
[Node.js help repository]: https://github.com/nodejs/help/issues
[notes about the waiting time]: #waiting-until-the-pull-request-gets-landed
[Onboarding guide]: ./doc/onboarding.md
[on GitHub]: https://github.com/nodejs/node
[Technical Steering Committee (TSC) repository]: https://github.com/nodejs/TSC/issues
1 change: 0 additions & 1 deletion doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,6 @@ assert(Object.is(str1 / 1, str2 / 1));
For more information, see
[MDN's guide on equality comparisons and sameness][mdn-equality-guide].

[`Error`]: errors.html#errors_class_error
[`Error.captureStackTrace`]: errors.html#errors_error_capturestacktrace_targetobject_constructoropt
[`Map`]: https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Map
[`Object.is()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
Expand Down
2 changes: 1 addition & 1 deletion doc/api/async_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ new Promise((resolve) => resolve(true)).then((a) => {});

calls the following callbacks:

```
```text
init for PROMISE with id 5, trigger id: 1
promise resolve 5 # corresponds to resolve(true)
init for PROMISE with id 6, trigger id: 5 # the Promise returned by then()
Expand Down
1 change: 0 additions & 1 deletion doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,6 @@ unavailable.
[`Error`]: errors.html#errors_class_error
[`EventEmitter`]: events.html#events_class_eventemitter
[`JSON.stringify` spec]: https://tc39.github.io/ecma262/#sec-json.stringify
[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
[`subprocess.connected`]: #child_process_subprocess_connected
[`subprocess.disconnect()`]: #child_process_subprocess_disconnect
[`subprocess.kill()`]: #child_process_subprocess_kill_signal
Expand Down
1 change: 0 additions & 1 deletion doc/api/dns.md
Original file line number Diff line number Diff line change
Expand Up @@ -671,4 +671,3 @@ uses. For instance, _they do not use the configuration from `/etc/hosts`_.
[Implementation considerations section]: #dns_implementation_considerations
[rfc5952]: https://tools.ietf.org/html/rfc5952#section-6
[supported `getaddrinfo` flags]: #dns_supported_getaddrinfo_flags
[the official libuv documentation]: http://docs.libuv.org/en/latest/threadpool.html
3 changes: 1 addition & 2 deletions doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ points into ESM graphs at run time.
| `require('./foo.mjs')` | ES Modules have differing resolution and timing, use language standard `import()` |
| `import()` | pending newer V8 release used in Node.js |
| `import.meta` | pending V8 implementation |
| Loader Hooks | pending Node.js EP creation/consensus |

## Notable differences between `import` and `require`

Expand Down Expand Up @@ -175,7 +174,7 @@ export function resolve(specifier, parentModuleURL/*, defaultResolve */) {

With this loader, running:

```
```console
NODE_OPTIONS='--experimental-modules --loader ./custom-loader.mjs' node x.js
```

Expand Down
6 changes: 0 additions & 6 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -1937,7 +1937,6 @@ const req = http.request(options, (res) => {
```

[`'checkContinue'`]: #http_event_checkcontinue
[`'listening'`]: net.html#net_event_listening
[`'request'`]: #http_event_request
[`'response'`]: #http_event_response
[`Agent`]: #http_class_http_agent
Expand All @@ -1956,9 +1955,6 @@ const req = http.request(options, (res) => {
[`http.request()`]: #http_http_request_options_callback
[`message.headers`]: #http_message_headers
[`net.Server.close()`]: net.html#net_server_close_callback
[`net.Server.listen()`]: net.html#net_server_listen_handle_backlog_callback
[`net.Server.listen(path)`]: net.html#net_server_listen_path_backlog_callback
[`net.Server.listen(port)`]: net.html#net_server_listen_port_host_backlog_callback
[`net.Server`]: net.html#net_class_net_server
[`net.Socket`]: net.html#net_class_net_socket
[`net.createConnection()`]: net.html#net_net_createconnection_options_connectlistener
Expand All @@ -1984,5 +1980,3 @@ const req = http.request(options, (res) => {
[Readable Stream]: stream.html#stream_class_stream_readable
[Writable Stream]: stream.html#stream_class_stream_writable
[socket.unref()]: net.html#net_socket_unref
[unspecified IPv4 address]: https://en.wikipedia.org/wiki/0.0.0.0
[unspecified IPv6 address]: https://en.wikipedia.org/wiki/IPv6_address#Unspecified_address
1 change: 0 additions & 1 deletion doc/api/https.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ const req = https.request(options, (res) => {
[`http.Server`]: http.html#http_class_http_server
[`http.close()`]: http.html#http_server_close_callback
[`http.get()`]: http.html#http_http_get_options_callback
[`http.listen()`]: http.html#http_server_listen_port_hostname_backlog_callback
[`http.request()`]: http.html#http_http_request_options_callback
[`https.Agent`]: #https_class_https_agent
[`https.request()`]: #https_https_request_options_callback
Expand Down
1 change: 0 additions & 1 deletion doc/api/os.md
Original file line number Diff line number Diff line change
Expand Up @@ -1186,5 +1186,4 @@ The following error codes are specific to the Windows operating system:

[`process.arch`]: process.html#process_process_arch
[`process.platform`]: process.html#process_process_platform
[OS Constants]: #os_os_constants
[uname(3)]: https://linux.die.net/man/3/uname
1 change: 0 additions & 1 deletion doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,6 @@ cases:
[`Error`]: errors.html#errors_class_error
[`EventEmitter`]: events.html#events_class_eventemitter
[`JSON.stringify` spec]: https://tc39.github.io/ecma262/#sec-json.stringify
[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
[`console.error()`]: console.html#console_console_error_data_args
[`console.log()`]: console.html#console_console_log_data_args
[`end()`]: stream.html#stream_writable_end_chunk_encoding_callback
Expand Down
1 change: 0 additions & 1 deletion doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -2224,7 +2224,6 @@ contain multi-byte characters.
[http-incoming-message]: http.html#http_class_http_incomingmessage
[zlib]: zlib.html
[hwm-gotcha]: #stream_highwatermark_discrepency_after_calling_readable_setencoding
[Readable]: #stream_class_stream_readable
[stream-_flush]: #stream_transform_flush_callback
[stream-_read]: #stream_readable_read_size_1
[stream-_transform]: #stream_transform_transform_chunk_encoding_callback
Expand Down
2 changes: 1 addition & 1 deletion doc/api/zlib.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ Creates and returns a new [DeflateRaw][] object with the given [options][].
is set to 8 for raw deflate streams. zlib does not have a working implementation
of an 8-bit Window for raw deflate streams and would automatically set windowBit
to 9 if initially set to 8. Newer versions of zlib will throw an exception.
This creates a potential DOS vector, and as such the behavior ahs been reverted
This creates a potential DOS vector, and as such the behavior has been reverted
in Node.js 8, 6, and 4. Node.js version 9 and higher will throw when windowBits
is set to 8.

Expand Down
33 changes: 29 additions & 4 deletions doc/changelogs/CHANGELOG_V8.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
</tr>
<tr>
<td>
<a href="#8.8.1">8.8.1</a><br/>
<a href="#8.8.0">8.8.0</a><br/>
<a href="#8.7.0">8.7.0</a><br/>
<a href="#8.6.0">8.6.0</a><br/>
Expand Down Expand Up @@ -34,6 +35,30 @@
* [io.js](CHANGELOG_IOJS.md)
* [Archive](CHANGELOG_ARCHIVE.md)

<a id="8.8.1"></a>
## 2017-10-25, Version 8.8.1 (Current), @cjihrig

### Notable Changes

* **net**:
- Fix timeout with null handle issue. This is a regression in Node 8.8.0 [#16489](https://github.com/nodejs/node/pull/16489)

### Commits

* [[`db8c92fb42`](https://github.com/nodejs/node/commit/db8c92fb42)] - **doc**: fix spelling in v8.8.0 changelog (Myles Borins) [#16477](https://github.com/nodejs/node/pull/16477)
* [[`c8396b8370`](https://github.com/nodejs/node/commit/c8396b8370)] - **doc**: remove loader hooks from unsupported features (Teppei Sato) [#16465](https://github.com/nodejs/node/pull/16465)
* [[`2b0bb57055`](https://github.com/nodejs/node/commit/2b0bb57055)] - **doc**: fix wrong URL (Jon Moss) [#16470](https://github.com/nodejs/node/pull/16470)
* [[`9ffc32974e`](https://github.com/nodejs/node/commit/9ffc32974e)] - **doc**: fix typo in changelog for 8.8.0 (Alec Perkins) [#16462](https://github.com/nodejs/node/pull/16462)
* [[`7facaa5031`](https://github.com/nodejs/node/commit/7facaa5031)] - **doc**: fix missing newline character (Daijiro Wachi) [#16447](https://github.com/nodejs/node/pull/16447)
* [[`16eb7d3a5f`](https://github.com/nodejs/node/commit/16eb7d3a5f)] - **doc**: fix doc styles (Daijiro Wachi) [#16385](https://github.com/nodejs/node/pull/16385)
* [[`99fdc1d04f`](https://github.com/nodejs/node/commit/99fdc1d04f)] - **doc**: add recommendations for first timers (Refael Ackermann) [#16350](https://github.com/nodejs/node/pull/16350)
* [[`6fbef7f350`](https://github.com/nodejs/node/commit/6fbef7f350)] - **doc**: fix typo in zlib.md (Luigi Pinca) [#16480](https://github.com/nodejs/node/pull/16480)
* [[`655e017e40`](https://github.com/nodejs/node/commit/655e017e40)] - **net**: fix timeout with null handle (Anatoli Papirovski) [#16489](https://github.com/nodejs/node/pull/16489)
* [[`7fad10cc7e`](https://github.com/nodejs/node/commit/7fad10cc7e)] - **test**: make test-v8-serdes work without stdin (Anna Henningsen)
* [[`12dc06e3e1`](https://github.com/nodejs/node/commit/12dc06e3e1)] - **test**: call toLowerCase on the resolved module (Daniel Bevenius) [#16486](https://github.com/nodejs/node/pull/16486)
* [[`10894c3835`](https://github.com/nodejs/node/commit/10894c3835)] - **test**: allow for different nsswitch.conf settings (Daniel Bevenius) [#16378](https://github.com/nodejs/node/pull/16378)
* [[`2a53165aa0`](https://github.com/nodejs/node/commit/2a53165aa0)] - **test**: add missing assertion (cjihrig) [#15519](https://github.com/nodejs/node/pull/15519)

<a id="8.8.0"></a>
## 2017-10-24, Version 8.8.0 (Current), @MylesBorins

Expand All @@ -42,8 +67,8 @@
* **crypto**:
- expose ECDH class [#8188](https://github.com/nodejs/node/pull/8188)
* **http2**:
- http2 is now exposed by defualt without the need for a flag [#15685](https://github.com/nodejs/node/pull/15685)
- a new environment varible NODE\_NO\_HTTP2 has been added to allow userland http2 to be required [#15685](https://github.com/nodejs/node/pull/15685)
- http2 is now exposed by default without the need for a flag [#15685](https://github.com/nodejs/node/pull/15685)
- a new environment variable NODE\_NO\_HTTP2 has been added to allow userland http2 to be required [#15685](https://github.com/nodejs/node/pull/15685)
- support has been added for generic `Duplex` streams [#16269](https://github.com/nodejs/node/pull/16269)
* **module**:
- resolve and instantiate loader pipeline hooks have been added to the ESM lifecycle [#15445](https://github.com/nodejs/node/pull/15445)
Expand Down Expand Up @@ -269,7 +294,7 @@
* [[`8e2064f093`](https://github.com/nodejs/node/commit/8e2064f093)] - **test**: fix ordering of strictEqual actual/expected (Chad Zezula) [#16008](https://github.com/nodejs/node/pull/16008)
* [[`b054a4e138`](https://github.com/nodejs/node/commit/b054a4e138)] - **test**: use fixtures.path instead of fixturesDir (Matthew Meyer) [#15984](https://github.com/nodejs/node/pull/15984)
* [[`68bfde9fb9`](https://github.com/nodejs/node/commit/68bfde9fb9)] - **test**: fix test-esm-addons (Rich Trott) [#16174](https://github.com/nodejs/node/pull/16174)
* [[`562d445999`](https://github.com/nodejs/node/commit/562d445999)] - **test**: use fixtures.readSync (szhang351)
* [[`562d445999`](https://github.com/nodejs/node/commit/562d445999)] - **test**: use fixtures.readSync (szhang351)
* [[`1469eff8f6`](https://github.com/nodejs/node/commit/1469eff8f6)] - **test**: replaced fixturesDir with common.fixtures (Dolapo Toki) [#15836](https://github.com/nodejs/node/pull/15836)
* [[`b463259efb`](https://github.com/nodejs/node/commit/b463259efb)] - **test**: use fixtures.fixturesDir (Gene Wu) [#15822](https://github.com/nodejs/node/pull/15822)
* [[`1e0a55529f`](https://github.com/nodejs/node/commit/1e0a55529f)] - **test**: replaces fixturesDir with fixtures methods (Christian Murphy) [#15817](https://github.com/nodejs/node/pull/15817)
Expand Down Expand Up @@ -576,7 +601,7 @@
* [[`94c6296d83`](https://github.com/nodejs/node/commit/94c6296d83)] - **tools**: use template literals (Sarah Meyer) [#15956](https://github.com/nodejs/node/pull/15956)
* [[`eebb2d775a`](https://github.com/nodejs/node/commit/eebb2d775a)] - **(SEMVER-MINOR)** **tools, build**: refactor macOS installer (JP Wesselink) [#15179](https://github.com/nodejs/node/pull/15179)
* [[`f68f572d7f`](https://github.com/nodejs/node/commit/f68f572d7f)] - **tty**: require readline at top of file (Bryan English) [#15647](https://github.com/nodejs/node/pull/15647)
* [[`d181147b2c`](https://genericithub.com/nodejs/node/commit/d181147b2c)] - **url**: const-ify APIs, and pass URL by ref (Sam Roberts) [#15615](https://github.com/nodejs/node/pull/15615)
* [[`d181147b2c`](https://github.com/nodejs/node/commit/d181147b2c)] - **url**: const-ify APIs, and pass URL by ref (Sam Roberts) [#15615](https://github.com/nodejs/node/pull/15615)
* [[`1cc4245bfb`](https://github.com/nodejs/node/commit/1cc4245bfb)] - **url**: fix remaining calculation (Rimas Misevičius) [#15637](https://github.com/nodejs/node/pull/15637)
* [[`34b4180d7d`](https://github.com/nodejs/node/commit/34b4180d7d)] - **url**: change variable name to be more descriptive (Yang-Kichang) [#15551](https://github.com/nodejs/node/pull/15551)
* [[`58c68c2fcb`](https://github.com/nodejs/node/commit/58c68c2fcb)] - **util**: use faster -0 check (Brian White) [#15726](https://github.com/nodejs/node/pull/15726)
Expand Down
Binary file added doc/first_timer_badge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion doc/guides/writing-and-running-benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,4 +438,4 @@ Supported options keys are:
[t-test]: https://en.wikipedia.org/wiki/Student%27s_t-test#Equal_or_unequal_sample_sizes.2C_unequal_variances
[git-for-windows]: http://git-scm.com/download/win
[nghttp2.org]: http://nghttp2.org
[benchmark-ci]: https://github.com/nodejs/benchmarking/blob/master/docs/core_benchmarks.md
[benchmark-ci]: https://github.com/nodejs/benchmarking/blob/master/docs/core_benchmarks.md
16 changes: 9 additions & 7 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,15 @@ Socket.prototype.setTimeout = function(msecs, callback) {


Socket.prototype._onTimeout = function() {
// `.prevWriteQueueSize` !== `.updateWriteQueueSize()` means there is
// an active write in progress, so we suppress the timeout.
const prevWriteQueueSize = this._handle.writeQueueSize;
if (prevWriteQueueSize > 0 &&
prevWriteQueueSize !== this._handle.updateWriteQueueSize()) {
this._unrefTimer();
return;
if (this._handle) {
// `.prevWriteQueueSize` !== `.updateWriteQueueSize()` means there is
// an active write in progress, so we suppress the timeout.
const prevWriteQueueSize = this._handle.writeQueueSize;
if (prevWriteQueueSize > 0 &&
prevWriteQueueSize !== this._handle.updateWriteQueueSize()) {
this._unrefTimer();
return;
}
}
debug('_onTimeout');
this.emit('timeout');
Expand Down
2 changes: 1 addition & 1 deletion src/node_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#define NODE_MAJOR_VERSION 8
#define NODE_MINOR_VERSION 8
#define NODE_PATCH_VERSION 1
#define NODE_PATCH_VERSION 2

#define NODE_VERSION_IS_RELEASE 0

Expand Down
7 changes: 5 additions & 2 deletions test/parallel/test-dgram-multicast-set-interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ const dgram = require('dgram');
socket.bind(0);
socket.on('listening', common.mustCall(() => {
// Try to set with an invalid interfaceAddress (wrong address class)
//
// This operation succeeds on some platforms, throws `EINVAL` on some
// platforms, and throws `ENOPROTOOPT` on others. This is unpleasant, but
// we should at least test for it.
try {
socket.setMulticastInterface('::');
throw new Error('Not detected.');
} catch (e) {
console.error(`setMulticastInterface: wrong family error is: ${e}`);
assert(e.code === 'EINVAL' || e.code === 'ENOPROTOOPT');
}

socket.close();
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-https-connect-address-family.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function runTest() {

dns.lookup('localhost', { family: 6, all: true }, (err, addresses) => {
if (err) {
if (err.code === 'ENOTFOUND')
if (err.code === 'ENOTFOUND' || err.code === 'EAI_AGAIN')
common.skip('localhost does not resolve to ::1');

throw err;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ const c = net.createConnection(0, 'this.hostname.is.invalid');
c.on('connect', common.mustNotCall());

c.on('error', common.mustCall(function(e) {
assert.strictEqual(e.code, 'ENOTFOUND');
// If Name Service Switch is available on the operating system then it
// might be configured differently (/etc/nsswitch.conf).
// If the system is configured with no dns the error code will be EAI_AGAIN,
// but if there are more services after the dns entry, for example some
// linux distributions ship a myhostname service by default which would
// still produce the ENOTFOUND error.
assert.ok(e.code === 'ENOTFOUND' || e.code === 'EAI_AGAIN');
assert.strictEqual(e.port, 0);
assert.strictEqual(e.hostname, 'this.hostname.is.invalid');
}));
8 changes: 7 additions & 1 deletion test/parallel/test-net-connect-immediate-finish.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ const client = net.connect({
client.once('error', common.mustCall((err) => {
assert(err);
assert.strictEqual(err.code, err.errno);
assert.strictEqual(err.code, 'ENOTFOUND');
// If Name Service Switch is available on the operating system then it
// might be configured differently (/etc/nsswitch.conf).
// If the system is configured with no dns the error code will be EAI_AGAIN,
// but if there are more services after the dns entry, for example some
// linux distributions ship a myhostname service by default which would
// still produce the ENOTFOUND error.
assert.ok(err.code === 'ENOTFOUND' || err.code === 'EAI_AGAIN');
assert.strictEqual(err.host, err.hostname);
assert.strictEqual(err.host, 'this.hostname.is.invalid');
assert.strictEqual(err.syscall, 'getaddrinfo');
Expand Down
Loading