0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

10902 Commits

Author SHA1 Message Date
simon
341c06f088 tls: expose SSL_export_keying_material
Fixes: https://github.com/nodejs/node/issues/31802

PR-URL: https://github.com/nodejs/node/pull/31814
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-02-23 01:21:04 -04:00
Tobias Nießen
0e63a079e8 crypto: fix ieee-p1363 for createVerify
Fixes: https://github.com/nodejs/node/issues/31866

PR-URL: https://github.com/nodejs/node/pull/31876
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-22 22:09:55 -04:00
Robert Nagy
21bd6679ce stream: fix finished typo
https://github.com/nodejs/node/pull/31509 introduced a slight typo.
Fortunately this typo does not have big impact due to
`isWritableFinished()`.

Fixes: https://github.com/nodejs/node/pull/31509#discussion_r381809355

PR-URL: https://github.com/nodejs/node/pull/31881
Fixes: https://github.com/nodejs/node/issues/31509
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-02-22 10:39:18 +01:00
Rich Trott
cdac18519f test: remove flaky designation for test-net-connect-options-port
Closes: https://github.com/nodejs/node/issues/23207

PR-URL: https://github.com/nodejs/node/pull/31841
Fixes: https://github.com/nodejs/node/issues/23207
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2020-02-20 08:00:23 -08:00
Rich Trott
1c4e984ed9 test: remove common.PORT from test-net-write-callbacks.js
Switch test-net-write-callbacks.js from common.PORT to a port assigned
by the operating system.

PR-URL: https://github.com/nodejs/node/pull/31839
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-02-19 18:57:51 -08:00
Harshitha KP
2d3717ad84
worker: emit runtime error on loop creation failure
Instead of hard asserting throw a runtime error,
that is more consumable.

Fixes: https://github.com/nodejs/node/issues/31614

PR-URL: https://github.com/nodejs/node/pull/31621
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-19 19:54:59 +01:00
Gus Caplan
b8e41774d4
fs: add fs/promises alias module
PR-URL: https://github.com/nodejs/node/pull/31553
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
2020-02-18 22:15:50 -08:00
Robert Nagy
8ba7a2f889 http2: make compat finished match http/1
finished should true directly after end().

PR-URL: https://github.com/nodejs/node/pull/24347
Refs: https://github.com/nodejs/node/issues/24743
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-18 20:54:31 +01:00
Guy Bedford
58de9b46b8 module: package "exports" error refinements
PR-URL: https://github.com/nodejs/node/pull/31625
Reviewed-By: Jan Krems <jan.krems@gmail.com>
2020-02-18 13:34:40 +02:00
Rich Trott
af19f4116c test: remove common.PORT from test-net-pause
Switch test-net-pause from common.PORT to a port assigned by the
operating system.

PR-URL: https://github.com/nodejs/node/pull/31749
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-02-17 18:07:37 -08:00
Rich Trott
a092886b1d test: remove common.PORT from test-tls-server-large-request
Switch test-tls-server-large-request from common.PORT to a port assigned
by the operating system.

PR-URL: https://github.com/nodejs/node/pull/31749
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-02-17 18:07:36 -08:00
Rich Trott
76fd17a7df test: remove common.PORT from test-net-throttle
Switch test-net-throttle from common.PORT to a port assigned by the
operating system.

PR-URL: https://github.com/nodejs/node/pull/31749
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-02-17 18:07:34 -08:00
Rich Trott
794bfacb26 test: remove common.PORT from test-net-timeout
Switch test-net-timeout from common.PORT to a port assigned by the
operating system.

PR-URL: https://github.com/nodejs/node/pull/31749
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-02-17 18:07:32 -08:00
Anna Henningsen
fab3eff2e5
src: inform callback scopes about exceptions in HTTP parser
Refs: 4aca277f16
Refs: https://github.com/nodejs/node/pull/30236
Fixes: https://github.com/nodejs/node/issues/31796

PR-URL: https://github.com/nodejs/node/pull/31801
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2020-02-18 02:50:02 +01:00
Robert Nagy
85c6fcd1cd stream: avoid writing to writable
A remainder from a previous refactoring.

Refs: https://github.com/nodejs/node/pull/31197

PR-URL: https://github.com/nodejs/node/pull/31805
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-17 23:31:08 +01:00
James M Snell
5bef2ccf20 test: add known issue test for sync writable callback
If the write callbacks are invoked synchronously with an
error, onwriteError would cause the error event to be
emitted synchronously, making it impossible to attach
an error handler after the call that triggered it.

PR-URL: https://github.com/nodejs/node/pull/31756
Refs: b0d469c69c
Refs: https://github.com/nodejs/quic/pull/341
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2020-02-17 08:09:29 -08:00
Robert Nagy
568fdfb165 fs: fix WriteStream autoClose order
WriteStream autoClose was implemented by manually
calling .destroy() instead of using autoDestroy
and callback. This caused some invariants related
to order of events to be broken.

Fixes: https://github.com/nodejs/node/issues/31776

PR-URL: https://github.com/nodejs/node/pull/31790
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-02-16 14:33:20 +01:00
Robert Nagy
c776a37791 http: end with data can cause write after end
Calling end() with data while ending should trigger
a write after end error.

PR-URL: https://github.com/nodejs/node/pull/28666
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-16 10:22:17 +01:00
legendecas
75311dbc2f
async_hooks: ensure event after been emitted on runInAsyncScope
The exception handler user-defined will not automatically emit after
for the async resource.

Also removes a duplicated case
`test-emit-after-uncaught-exception-runInAsyncScope.js`
which is identical to test-emit-after-uncaught-exception.js.

Refs: https://github.com/nodejs/node/pull/30965
PR-URL: https://github.com/nodejs/node/pull/31784
Fixes: https://github.com/nodejs/node/issues/31783
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-14 16:55:02 +01:00
Robert Nagy
df1592d2e9 test: async iterate destroyed stream
PR-URL: https://github.com/nodejs/node/pull/28995
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-02-14 16:39:08 +01:00
Robert Nagy
0c7ff7fcfb stream: simplify Writable.write
Slightly refactors Writable.write for minor perf
and readability improvements.

PR-URL: https://github.com/nodejs/node/pull/31146
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
2020-02-14 14:29:46 +01:00
Robert Nagy
0875837417 stream: fix async iterator destroyed error order
There was an edge case where if _destroy calls the error callback
later than one tick the iterator would complete early and not
propgate the error.

PR-URL: https://github.com/nodejs/node/pull/31314
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/31700
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-14 08:44:05 +01:00
Rich Trott
9a1c19bb28 test: mark test-fs-stat-bigint flaky on FreeBSD
Refs: https://github.com/nodejs/node/issues/31727

PR-URL: https://github.com/nodejs/node/pull/31728
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-13 22:21:02 -08:00
Antoine du HAMEL
611a158f1a
worker: add support for .cjs extension
PR-URL: https://github.com/nodejs/node/pull/31662
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-02-13 21:32:01 +01:00
Ruben Bridgewater
9da57a86ee
test: fix flaky parallel/test-repl-history-navigation test
Two scenarios should be tested:

1. The completion is triggered and the result is printed before the
   next invocation.
2. The completion is triggered multiple times right after each other
   without waiting for the result. In that case only the last result
   should be printed.

The first scenario did not need a timeout while the latter did not
need a timeout for the second invocation.

PR-URL: https://github.com/nodejs/node/pull/31708
Fixes: https://github.com/nodejs/node/issues/31094
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-13 21:18:30 +01:00
Rich Trott
d565041876
test: improve test-fs-stat-bigint
Remove magic number and measure amount of difference should be allowable
between consecutive stat() calls.

PR-URL: https://github.com/nodejs/node/pull/31726
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-13 21:16:25 +01:00
Rich Trott
481fa1ca98
util: add coverage for util.inspect.colors alias setter
Add test to confirm that the setter for aliases in `util.inspect.colors`
keeps the alias reference-equal to the target value.

Refs: https://coverage.nodejs.org/coverage-5b0308cd823a5110/lib/internal/util/inspect.js.html#L357
Refs: 5b0308cd82/lib/internal/util/inspect.js (L357)

PR-URL: https://github.com/nodejs/node/pull/31743
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-13 21:00:21 +01:00
Denys Otrishko
d63bcdd9cd
worker: properly handle env and NODE_OPTIONS in workers
PR-URL: https://github.com/nodejs/node/pull/31711
Fixes: https://github.com/nodejs/node/issues/30627
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2020-02-13 16:05:27 +01:00
ZYSzys
3e9302b2b3 fs: validate the input data before opening file
PR-URL: https://github.com/nodejs/node/pull/31731
Refs: https://github.com/nodejs/node/pull/31030
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
2020-02-13 21:34:29 +08:00
Matteo Collina
9fdb6e6aaf
async_hooks: add executionAsyncResource
Remove the need for the destroy hook in the basic APM case.

Co-authored-by: Stephen Belanger <admin@stephenbelanger.com>
PR-URL: https://github.com/nodejs/node/pull/30959
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-11 20:59:09 +01:00
Rich Trott
fb437c49cf test: remove flaky designation for test-fs-stat-bigint
PR-URL: https://github.com/nodejs/node/pull/30437
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-10 19:03:49 -10:00
Duncan Healy
acfb78b531 test: fix flaky test-fs-stat-bigint
Change test limit for atime from 2ms to 5ms. Add comment explaining why
the wiggle room is needed.

Fixes: https://github.com/nodejs/node/issues/24593

PR-URL: https://github.com/nodejs/node/pull/30437
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-10 19:03:47 -10:00
Anna Henningsen
4671d551cf
Revert "benchmark: add test and all options and improve errors"
This reverts commit dac579516c.

Refs: https://github.com/nodejs/node/pull/31396
PR-URL: https://github.com/nodejs/node/pull/31722
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-02-10 22:35:35 +01:00
Anna Henningsen
aa0a01bd36
Revert "test: refactor all benchmark tests to use the new test option"
This reverts commit 78aa348f4e.

Refs: https://github.com/nodejs/node/pull/31396
PR-URL: https://github.com/nodejs/node/pull/31722
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-02-10 22:35:33 +01:00
Denys Otrishko
c405e9b23c
lib: improve value validation utils
Add common validators: `validateArray`, `validateBoolean`,
`validateObject` and appropriate tests.

PR-URL: https://github.com/nodejs/node/pull/31480
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2020-02-10 21:40:41 +02:00
Rich Trott
81af195b5d test: add debugging output to test-net-listen-after-destroy-stdin
The test failed in CI once with a timeout but there is insufficient
information to further debug. Add additional debugging information.

Refactored callbacks to be arrow functions, since that seems to be the
direction we're moving.

PR-URL: https://github.com/nodejs/node/pull/31698
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-02-10 09:03:35 -10:00
Rich Trott
84836df150 test: improve assertion message in test-dns-any
Improve error message from "The expression evaluated to a falsy value"
to a message formatted dynamically that lists the record types found so
that someone investigating can look at the code and determine which
values are missing.

This came up because the test failed in nightly master branch CI but
generally passes. It may prove helpful to know what record types were
missing. (All of them? Just one? Something else?)

PR-URL: https://github.com/nodejs/node/pull/31697
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-10 07:42:44 -10:00
Anna Henningsen
5100e84f4b
test: fix flaky test-fs-promises-file-handle-close
Sometimes, the expected warnings were not emitted.
To harden the test:

- Instead of relying on a timeout that raced against the file being
  opened, wait until the file is opened and then schedule GC
  after that.
- Explicitly keep the event loop alive for one turn to make sure
  the warning is being seen.

PR-URL: https://github.com/nodejs/node/pull/31687
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-10 15:42:22 +01:00
Anna Henningsen
0649225be4
test: fix flaky test-trace-sigint-on-idle
Previously, the test could fail on slow machines because the
child process was still in the process of starting up after
one second, and not yet idle.

To resolve this:
- Wait for a message from the child process indicating that it
  had started.
- Wait some time after that, but make it platform-dependent to
  account for timing differences.
- Remove the timer in the child process.

PR-URL: https://github.com/nodejs/node/pull/31645
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-09 22:16:23 +01:00
Rich Trott
743c28104f test,dns: add coverage for dns exception
Add test coverage for dns.promises.resolve() handling an exception from
c-ares.

Refs: https://coverage.nodejs.org/coverage-d213f21c72f77da6/lib/internal/dns/promises.js.html#L198

PR-URL: https://github.com/nodejs/node/pull/31678
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-02-09 07:36:08 -10:00
cjihrig
009a9c475b
doc,src,test: assign missing deprecation code
PR-URL: https://github.com/nodejs/node/pull/31674
Refs: https://github.com/nodejs/node/pull/28396
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-02-09 11:38:29 -05:00
Ruben Bridgewater
63f10b9f0d
tty: do not end in an infinite warning recursion
It was possible that this warning ends up in an infinite recursion.
The reason is that printing the warning triggered a color check and
that triggered another warning. Limiting it to a single warning
prevents this.

PR-URL: https://github.com/nodejs/node/pull/31429
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-09 13:39:56 +01:00
Ruben Bridgewater
0f6fed4f07
test: stricter assert color test
Make sure the assertion is actually triggered by using
`assert.throws()` instead of `try/catch`.

PR-URL: https://github.com/nodejs/node/pull/31429
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-09 13:39:55 +01:00
Ruben Bridgewater
36f328e21f
assert: align character indicators properly
This makes sure color codes are not taken into account in case
util.inspect's default value was changed.

PR-URL: https://github.com/nodejs/node/pull/31429
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-02-09 13:39:54 +01:00
Ruben Bridgewater
1450ea7bf6
test: improve logged errors
To indicate which lines are test lines and which from Node.js core,
it's good to rely on `util.inspect()` while inspecting errors.

The stack was accessed directly instead in multiple cases and logging
that does not provide as much information as using `util.inspect()`.

PR-URL: https://github.com/nodejs/node/pull/31425
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yihong Wang <yh.wang@ibm.com>
2020-02-09 13:36:39 +01:00
Ruben Bridgewater
78aa348f4e
test: refactor all benchmark tests to use the new test option
PR-URL: https://github.com/nodejs/node/pull/31396
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-09 13:31:54 +01:00
Ruben Bridgewater
dac579516c
benchmark: add test and all options and improve errors
This adds a new `test` option. Using it automatically uses a single
minimal option matrix to verify the benchmark works as expected.

Using the new `all` option makes sure all test suites are run.

On top of that the benchmarks will from now on report properly
what category might have a typo, if any.

The http duration was also refactored to use a option instead of
relying on a configuration setting.

The fixture folder is ignored as test suite from now on.

PR-URL: https://github.com/nodejs/node/pull/31396
Fixes: https://github.com/nodejs/node/issues/31083
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-09 13:31:45 +01:00
Robert Nagy
d016b9d708 stream: finished callback for closed streams
Previously finished(stream, cb) would not invoke the callback
for streams that have already finished, ended or errored
before being passed to finished(stream, cb).

PR-URL: https://github.com/nodejs/node/pull/31509
Refs: https://github.com/nodejs/node/pull/31508
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-08 23:34:40 +01:00
Robert Nagy
e559842188 stream: make readable & writable computed
This makes readable and writable automatically computed based
on the stream state.

Effectivly deprecating/discouraging manual management of this.

Makes the properties  more consistent and easier to reason about.

Fixes: https://github.com/nodejs/node/issues/29377

PR-URL: https://github.com/nodejs/node/pull/31197
Refs: https://github.com/nodejs/node/issues/29377
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-08 23:23:12 +01:00
Anna Henningsen
9111e02360
worker: reset Isolate stack limit after entering Locker
It turns out that using `v8::Locker` undoes the effects of
passing an explicit stack limit as part of the `Isolate`’s
resource constraints.

Therefore, reset the stack limit manually after entering a Locker.

Refs: https://github.com/nodejs/node/pull/26049#issuecomment-580668530

PR-URL: https://github.com/nodejs/node/pull/31593
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-08 15:16:59 +01:00