Commit Graph

706 Commits

Author SHA1 Message Date
Rich Trott
660265e108 test: move test-worker-eventlooputil to sequential
The test is not nearly as unreliable as it used to be but we're still
seeing failures around the timing checks that will definitely be
affected by other tests running in other processes. So move it to
sequential.

Refs: https://github.com/nodejs/node/pull/35961#issuecomment-722222696

PR-URL: https://github.com/nodejs/node/pull/35996
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2020-11-12 20:26:49 +00:00
James M Snell
05bb1b3f94 crypto: fixup scrypt regressions
Fixes a handful of regressions in scrypt support following
the refactor.

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

PR-URL: https://github.com/nodejs/node/pull/35821
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-30 11:08:09 +00:00
Tobias Nießen
30fb4a015d test: add common.mustSucceed
PR-URL: https://github.com/nodejs/node/pull/35086
Reviewed-By: Ruy Adorno <ruyadorno@github.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-17 00:48:26 +02:00
Dmitry Gozman
87da7a6d15 inspector: do not hardcode Debugger.CallFrameId in tests
Debugger.CallFrameId is defined as an opaque string [1].

Some tests currently hardcode the value, relying on
undocumented internal details of V8. This makes it hard
for V8 to change the internal representation.

We should instead use the reported call frame id from
the Debugger.paused event directly. This is how every
inspector client does it.

[1] https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#type-CallFrameId

PR-URL: https://github.com/nodejs/node/pull/35570
Reviewed-By: Aleksei Koziatinskii <ak239spb@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-13 00:30:24 +00:00
James M Snell
dae283d96f
crypto: refactoring internals, add WebCrypto
Fixes: https://github.com/nodejs/node/issues/678
Refs: https://github.com/nodejs/node/issues/26854

Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/35093
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-10-07 17:27:05 -07:00
Michaël Zasso
21782277c2
src: use node:moduleName as builtin module filename
This change allows for easier recognition of builtin modules in stack
traces.

Refs: https://github.com/nodejs/node/issues/11893

PR-URL: https://github.com/nodejs/node/pull/35498
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-10-07 17:35:14 +02:00
Rich Trott
f593f9e9ef test: adjust comments for upcoming lint rule
Enforce `//` for multiline comments. Some tests mixed and matched, and
at least one did so in a (to me) surprising way.

PR-URL: https://github.com/nodejs/node/pull/35485
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-10-07 04:36:02 -07:00
Dan Fabulich
3b10f7f933
process: change default --unhandled-rejections=throw
This is a semver-major change that resolves DEP0018.

All users that have set an unhandledRejection hook or set a non-default
value for the --unhandled-rejections flag will see no change in behavior
after this change.

Refs: https://nodejs.org/dist/latest/docs/api/deprecations.html#deprecations_dep0018_unhandled_promise_rejections

PR-URL: https://github.com/nodejs/node/pull/33021
Fixes: https://github.com/nodejs/node/issues/20392
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2020-09-22 12:29:32 -07:00
Denys Otrishko
c66e6471e7
lib: remove ERR_INVALID_OPT_VALUE and ERR_INVALID_OPT_VALUE_ENCODING
This will be a start to generalize all argument validation
errors. As currently we throw ARG/OPT, OUT_OF_RANGE, and other more
specific errors.
The OPT errors didn't bring much to the errors as it's just another
variant of ARG error which is sometimes more confusing (some of our code
used OPT errors to denote just argument validation errors presumably
because of similarity of OPT to 'option' and not 'options-object')
and they don't specify the name of the options object where the invalid
value is located. Much better approach would be to just specify path
to the invalid value in the name of the value as it is done in this PR
(i.e. 'options.format', 'options.publicKey.type' etc)

Also since this decreases a variety of errors we have it'd be easier to
reuse validation code across the codebase.

Refs: https://github.com/nodejs/node/pull/31251
Refs: https://github.com/nodejs/node/pull/34070#discussion_r467251009
Signed-off-by: Denys Otrishko <shishugi@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/34682
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-09-11 17:54:42 +03:00
Pooja D.P
00000000fb test: change var to let
PR-URL: https://github.com/nodejs/node/pull/34902
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2020-09-05 12:53:45 +02:00
Bradley Farias
4234904232 policy: implement scopes field
PR-URL: https://github.com/nodejs/node/pull/34552
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-08-26 14:35:34 -05:00
Rich Trott
76f86c3ed4 test: move test-inspector-already-activated-cli to parallel
There doesn't seem to be a reason for this test to have to stay in
sequential. It appears to have been placed there out of caution.

PR-URL: https://github.com/nodejs/node/pull/34755
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-08-18 07:23:18 -07:00
Rich Trott
42a3a7f97d test: remove common.rootDir
The three tests that use common.rootDir do not need the root dir. They
just need an arbitrary directory that will exist. Use tmpdir.path
instead.

PR-URL: https://github.com/nodejs/node/pull/34772
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2020-08-16 07:56:09 -07:00
Bradley Farias
bcfb1762a3 util: add debug and debuglog.enabled
PR-URL: https://github.com/nodejs/node/pull/33424
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-08-10 12:09:43 -05:00
AshCripps
242bfb6bfc
src: allow setting a dir for all diagnostic output
Add a flag that allows for the setting of a directory where all
diagnostic output will be written to.
e.g. --redirect-warnings

Refs: https://github.com/nodejs/node/pull/33010#issuecomment-618544792

PR-URL: https://github.com/nodejs/node/pull/33584
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-20 18:20:18 +02:00
Anna Henningsen
2c4ebe0426
test: use .then(common.mustCall()) for all async IIFEs
This makes sure that all async functions finish as expected.

PR-URL: https://github.com/nodejs/node/pull/34363
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-07-20 18:13:28 +02:00
Rich Trott
bf0d82c102 test: remove common.localhostIPv6
common.localhostIPv6 is almost entirely unused and is unnecessary.
Remove it.

PR-URL: https://github.com/nodejs/node/pull/34373
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-07-16 16:57:30 -07:00
James M Snell
79c0e892dd quic: implement QuicSocket Promise API, part 1
PR-URL: https://github.com/nodejs/node/pull/34283
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-15 17:16:50 -07:00
James M Snell
7b062ca015 quic: refactor qlog handling
Because of the timing of qlog events emitted by ngtcp2, it
becomes difficult to handle those as events on the QuicSession
object because the final qlog entry is not emitted until the
ngtcp2_conn is freed, which can occur when the object is being
garbage collected (meaning, we a: can't call out to javascript
and b: don't have an object we can use to emit the event).

This refactors it into a QLogStream object that allows the
qlog data to be piped out using a separate Readable stream.

PR-URL: https://github.com/nodejs/node/pull/34160
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-07-05 14:17:33 -07:00
Anna Henningsen
1d7be3253f crypto: move typechecking for timingSafeEqual into C++
This makes the function more robust against V8 inlining.

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

PR-URL: https://github.com/nodejs/node/pull/34141
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
2020-07-03 12:01:03 -07:00
James M Snell
9f2e00fb99
quic: temporarily disable preferred address tests
The way the preferred address mechanism is supposed to work
is this: A server might be exposed via multiple network
interfaces / addresses. The preferred address is the one that
clients should use. If a client uses one of the non-preferred
addresses to initially connect to the server, the server will
include the preferred address in it's initial transport params
back to the client over the original connection. The client
then can make a choice: it can either choose to ignore the
advertised preferred address and continue using the original,
or it can transition the in-flight connection to the preferred
address without having to restart the connection. In the latter
case, the connection will start making use of the preferred
address but it might not do so immediately.

To test this mechanism properly, we should have our server
configured on multiple endpoints with one of those marked
as the preferred. The connection should start on one and preceed
uninterrupted to completion. If the preferred address policy
is "accept", the client will accept and transition to the servers
preferred address transparently, without interupting the flow.

The current test is deficient because the server is only listening
on a single address which is also advertised as the preferred.
While the client should get the advertisement, we're not actually
making use of the preferred address advertisement and nothing on
the connection changes

The ipv6 version of the test is also hanging on some platforms and
it's not entirely clear why yet.

PR-URL: https://github.com/nodejs/node/pull/33934
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-22 11:32:39 -07:00
James M Snell
272b46e04d
quic: skip test-quic-preferred-address-ipv6.js when no ipv6
PR-URL: https://github.com/nodejs/node/pull/33919
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2020-06-17 11:35:02 -07:00
James M Snell
55360443ce
quic: initial QUIC implementation
Co-authored-by: Anna Henningsen <anna@addaleax.net>
Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com>
Co-authored-by: gengjiawen <technicalcute@gmail.com>
Co-authored-by: James M Snell <jasnell@gmail.com>
Co-authored-by: Lucas Pardue <lucaspardue.24.7@gmail.com>
Co-authored-by: Ouyang Yadong <oyydoibh@gmail.com>
Co-authored-by: Juan Jos<C3><A9> Arboleda <soyjuanarbol@gmail.com>
Co-authored-by: Trivikram Kamat <trivikr.dev@gmail.com>
Co-authored-by: Denys Otrishko <shishugi@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32379
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-06-16 09:23:34 -07:00
James M Snell
a808cb76ce
test: add common/udppair utility
Extracted from the QUIC PR. This adds a utility used to
deterministically test UDP traffic. It is currently only
used by the experimental QUIC implementation. Separated
out on request to make review easier.

PR-URL: https://github.com/nodejs/node/pull/33380
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2020-06-16 06:56:06 -07:00
Brian White
c24b74a7ab
lib: improve debuglog() performance
PR-URL: https://github.com/nodejs/node/pull/32260
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-05-30 17:24:43 -04:00
Joyee Cheung
dd5f209213 inspector: throw error when activating an already active inspector
When the user tries to activate the inspector that is already active
on a different port and host, we previously just silently reset
the port and host stored in the Environment without actually doing
anything for that to be effective. After this patch, we throw
an error telling the user to close the active inspector before invoking
`inspector.open()` again.

PR-URL: https://github.com/nodejs/node/pull/33015
Fixes: https://github.com/nodejs/node/issues/33012
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2020-05-24 03:43:05 +02:00
Ruben Bridgewater
36b2e25b4a
tools: add eslint rule to only pass through 'test' to debuglog
This makes sure all usages of `util.debuglog()` must contain the
string 'test' as argument.

PR-URL: https://github.com/nodejs/node/pull/32161
Refs: https://github.com/nodejs/node/pull/32078
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-05-10 14:00:37 +02:00
Anna Henningsen
d5e1795f53
test: skip memory usage tests when ASAN is enabled
Running tests with an ASAN build leads to increased memory usage,
rendering the memory usage assumptions in the test invalid.

Refs: https://github.com/nodejs/node/pull/32776#issuecomment-620407014

PR-URL: https://github.com/nodejs/node/pull/33129
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-04-30 18:22:03 +02:00
Anna Henningsen
ab41b9808e test: move test-process-title to sequential
This test can fail when run in parallel with test-process-title-cli,
which also sets the process title, which is global state on Windows.

Example failure (note that `foo` does not appear in test-process-title
but in test-process-title-cli):

    not ok 1727 parallel/test-process-title
      ---
      duration_ms: 0.156
      severity: fail
      exitcode: 1
      stack: |-
        assert.js:103
          throw new AssertionError(obj);
          ^

        AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
        + actual - expected

        + 'foo'
        - 'd:\\a\\node\\node\\out\\Release\\node.exe'
            at Object.<anonymous> (d:\a\node\node\test\parallel\test-process-title.js:22:1)
            at Module._compile (internal/modules/cjs/loader.js:1176:30)
            at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
            at Module.load (internal/modules/cjs/loader.js:1040:32)
            at Function.Module._load (internal/modules/cjs/loader.js:929:14)
            at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
            at internal/main/run_main_module.js:17:47 {
          generatedMessage: true,
          code: 'ERR_ASSERTION',
          actual: 'foo',
          expected: 'd:\\a\\node\\node\\out\\Release\\node.exe',
          operator: 'strictEqual'
        }
      ...

(from https://github.com/nodejs/node/runs/628144750?check_suite_focus=true)

PR-URL: https://github.com/nodejs/node/pull/33150
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
2020-04-30 18:00:38 +03:00
Jeremiah Senkpiel
f8d5474839 test: remove timers-blocking-callback
If the bug this test is intented to catch is reintroduced, or if
5aac4c42da is effectively reverted, many
(50+) tests time out, rendering this test redundant and unnecessary.

in particular, the following timer tests catch an effective revert of
5aac4c42da:

not ok 21 parallel/test-timers-api-refs
not ok 22 parallel/test-timers-args
not ok 23 parallel/test-timers-destroyed
not ok 25 parallel/test-timers-nested
not ok 26 parallel/test-timers-interval-throw
not ok 28 parallel/test-timers-non-integer-delay
not ok 32 parallel/test-timers-ordering
not ok 33 parallel/test-timers-refresh
not ok 34 parallel/test-timers-refresh-in-callback
not ok 35 parallel/test-timers-reset-process-domain-on-throw
not ok 40 parallel/test-timers-timeout-to-interval
not ok 41 parallel/test-timers-uncaught-exception
not ok 42 parallel/test-timers-timeout-with-non-integer
not ok 43 parallel/test-timers-unenroll-unref-interval
not ok 44 parallel/test-timers-unref
not ok 45 parallel/test-timers-unref-active
not ok 46 parallel/test-timers-unrefd-interval-still-fires
not ok 47 parallel/test-timers-unrefed-in-callback
not ok 48 parallel/test-timers-user-call
not ok 49 parallel/test-timers-zero-timeout

Refs: https://github.com/nodejs/node/issues/21781

PR-URL: https://github.com/nodejs/node/pull/32870
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-04-25 22:24:19 -07:00
Qinhui Chen
6bcf968401 module: fix memory leak when require error occurs
Delete useless module in parent module: parent.children array
when error occurs, so that it can be garbage collected.

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

PR-URL: https://github.com/nodejs/node/pull/32837
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
2020-04-17 12:35:00 +03:00
Sam Roberts
3f5142daa8 test: mark cpu-prof-dir-worker flaky on all
Refs: https://github.com/nodejs/node/issues/27611#issuecomment-613100468

PR-URL: https://github.com/nodejs/node/pull/32828
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-04-14 19:53:16 -07:00
Sam Roberts
afae925fe9 test: mark test-worker-prof flaky on arm
Refs: https://github.com/nodejs/node/issues/26401#issuecomment-613095719

PR-URL: https://github.com/nodejs/node/pull/32826
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-04-14 10:59:00 -07:00
Anna Henningsen
e2ea73af04
test: make sure that inspector tests finish
PR-URL: https://github.com/nodejs/node/pull/32673
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-04-08 16:43:13 +02:00
Harshitha KP
bffc9324a1
test: harden the tick sampling logic
Under peculiar system load conditions, the profiler thread
does not get enough CPU slices to perform the sampling.
Improve the interaction between worker and parent thread
by performing a large disc read, which is a better blend of
CPU and I/O bound work, than earlier versions.
This produces x10 more samples than the existing one,
in 10 iterations, as opposed to 1024.

Also capture worker error situations to improve debugging

Refs: https://github.com/nodejs/node/issues/26401#issuecomment-597438516

PR-URL: https://github.com/nodejs/node/pull/32190
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-30 10:24:19 +02:00
Hassaan Pasha
3d0f2257be test: discard data received by client
This test was timing out after update to OpenSSL-1.1.1e.

PR-URL: https://github.com/nodejs/node/pull/32328
Fixes: https://github.com/nodejs/node/issues/32210
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-03-23 07:37:35 -07:00
Rich Trott
ecfb7b0988 test: replace countdown with Promise.all() in cluster-net-listen tests
PR-URL: https://github.com/nodejs/node/pull/32381
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-21 21:52:03 -07:00
Rich Trott
7d4dedbf6a test: replace Map with Array in cluster-net-listen tests
PR-URL: https://github.com/nodejs/node/pull/32381
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-03-21 21:51:59 -07:00
Matheus Marchini
2e3dc12ebd test: workaround for V8 8.1 inspector pause issue
`test-inspector-multisession-ws` and `test-inspector-break-when-eval`
will be affected by an upstream bug when we upgrade V8 to 8.1. The bug
is caused when the Inspector sets a pause at the start of a function
compiled with `CompileFunctionInContext`, but that function hasn't been
executed yet.

On both tests, this issue is triggered by pausing while in C++ executing
LookupAndCompile, which is called by requiring internal modules while
running `console.log`. To eliminate this issue in both tests, we add an
extra `console.log` to ensure we only pause we required all internal
modules we need. On `test-inspector-break-when-eval`, we also need to
start the child process with `--inspect-brk` instead of `--inspect` to
ensure the test is predictable (this test would occasianlly fail on
slower machines, when console.log doesn't run fast enough to finish
after emitting `Runtime.consoleAPICalled` and before the parent process
sending `Runtime.evaluate` message.

Ref: https://bugs.chromium.org/p/v8/issues/detail?id=10287

PR-URL: https://github.com/nodejs/node/pull/32234
Refs: https://bugs.chromium.org/p/v8/issues/detail?id=10287
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-03-16 00:23:53 +00:00
Myles Borins
e00e77e857
test: mark test-timers-blocking-callback flaky on osx
This is only for 10.15 but this test is periodically failing across
many CI runs. Would like to mark this as flaky so we can avoid lots
of red CI.

Refs: https://github.com/nodejs/node/issues/21781

PR-URL: https://github.com/nodejs/node/pull/32189
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
2020-03-11 10:31:46 -04:00
Rich Trott
1b35e8402f test: remove superfluous checks in test-net-reconnect-error
The process.on('exit', ...) checks duplicate the work of
`common.mustCall()` and are superfluous. Remove them.

Signed-off-by: Rich Trott <rtrott@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32120
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2020-03-08 08:25:38 -07:00
Rich Trott
4c6ef4b7e2 test: apply camelCase in test-net-reconnect-error
Rename two idnetifiers that were snake_case rather than camelCase.

Signed-off-by: Rich Trott <rtrott@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32120
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2020-03-08 08:25:31 -07:00
Rich Trott
b1d4c13430 test: add coverage for FSWatcher exception
Cover an previously uncovered exception possible in the internal start
function for FSWatcher.

Signed-off-by: Rich Trott <rtrott@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32057
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2020-03-05 07:10:05 -08:00
Rich Trott
616a729b38 test: remove common.expectsInternalAssertion
Remove convenience function for internal assertions. It is only used
once.

Signed-off-by: Rich Trott <rtrott@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/32057
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2020-03-05 07:10:01 -08:00
Rich Trott
5e1f059db4 test: move test-inspector-module to parallel
test-inspector-module is very fast and seems to be runnable at the same
time as other tests. Move from sequential directory to parallel.

PR-URL: https://github.com/nodejs/node/pull/32025
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-03-02 12:51:31 -08:00
Rich Trott
9ac42f1be4 test: remove common.port from test-tls-securepair-client
OpenSSL s_server accepts port 0 as an indicator to use an open port
provided by the operating system. Use that instead of common.PORT in the
test.

Remove 500ms delay added in 8e461673c4.
Hopefully the race condition in OpenSSL s_server has been fixed and/or
the change to port 0 means that the server is listening by the time
the ACCEPT text is printed and the setTimeout() is no longer necessary.

PR-URL: https://github.com/nodejs/node/pull/32024
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2020-03-02 12:50:06 -08:00
Rusty Conover
2b16c13f79 test: remove sequential/test-https-keep-alive-large-write.js
Remove a test that made a flawed assumption that a single
large buffer write can be interrupted by a timeout event.

PR-URL: https://github.com/nodejs/node/pull/31499
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-28 22:02:00 -08:00
cjihrig
1b2e2944bc
dgram: don't hide implicit bind errors
When dgram socket implicit binding fails, an attempt is made to
clean up the send queue. This was originally implemented using
an 'error' handler that performed cleanup and then emitted a
fake error, which concealed the original error. This was done
to prevent cases where the same error was emitted twice. Now
that the errorMonitor event is available, use that to perform
the cleanup without impacting the actual error handling.

PR-URL: https://github.com/nodejs/node/pull/31958
Refs: https://github.com/nodejs/help/issues/2484
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-02-27 21:01:32 -05:00
Anna Henningsen
875a4d1a58 worker: add ability to take heap snapshot from parent thread
PR-URL: https://github.com/nodejs/node/pull/31569
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-02-03 07:04:13 -08:00
legendecas
7b7e7bd185
src,lib: make ^C print a JS stack trace
If terminating the process with ctrl-c / SIGINT, prints a JS stacktrace
leading up to the currently executing code.

The feature would be enabled under option `--trace-sigint`.

Conditions of no stacktrace on sigint:

- has (an) active sigint listener(s);
- main thread is idle (i.e. uv polling), a message instead of stacktrace
  would be printed.

PR-URL: https://github.com/nodejs/node/pull/29207
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Christopher Hiller <boneskull@boneskull.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-28 13:52:27 +08:00