Commit Graph

825 Commits

Author SHA1 Message Date
Paolo Insogna 8b51c1a869 net: enable autoSelectFamily by default
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/46790
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2023-04-05 08:31:56 -07:00
Moshe Atlow 25858e3e7c
watch: fix watch path with equals
PR-URL: https://github.com/nodejs/node/pull/47369
Fixes: https://github.com/nodejs/node/issues/47296
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2023-04-05 08:08:24 +00:00
Moshe Atlow f6f3e22016 test: fix flaky test-watch-mode-inspect
PR-URL: https://github.com/nodejs/node/pull/47403
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2023-04-04 16:53:32 -07:00
Joyee Cheung 812e236df9
test: move debugger tests with --port=0 to parallel
Before

```
❯ tools/test.py "sequential/test-debugger*"
[00:25|% 100|+  32|-   0]: Done

All tests passed.
❯ tools/test.py -J "parallel/test-debugger*"
[00:05|% 100|+   6|-   0]: Done

All tests passed.
```

After

```
❯ tools/test.py "sequential/test-debugger*"
[00:06|% 100|+   5|-   0]: Done

All tests passed.
❯ tools/test.py -J "parallel/test-debugger*"
[00:05|% 100|+  33|-   0]: Done

All tests passed.
```

PR-URL: https://github.com/nodejs/node/pull/47274
Refs: https://github.com/nodejs/node/issues/47146
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-04-05 00:49:46 +02:00
Joyee Cheung 967779b3a1
test: use --port=0 in debugger tests that do not have to work on 9229
To avoid failures when there is another running process occupying
the port 9229 which may happen if there is a stale process, use the
--port argument of node-inspect to use a random port in tests that
don't have to work on port 9229.

The following tests are not touched:

- test-debugger-custom-port: tests a specific port
- test-debugger-debug-brk: tests a specific port
- test-debugger-invalid-args: tests other inspect combinations
- test-debugger-pid: node-inspect does not support -p and --port
  together
- test-debugger-launch: tests that default port is 9229

PR-URL: https://github.com/nodejs/node/pull/47274
Refs: https://github.com/nodejs/node/issues/47146
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-04-05 00:49:44 +02:00
Tobias Nießen 9e9f68af95
test: mark test-http-max-sockets as flaky on win32
Refs: https://github.com/nodejs/node/issues/47116
PR-URL: https://github.com/nodejs/node/pull/47134
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com>
2023-03-17 16:33:03 +00:00
Eungyu Lee f8bf4987e9
debugger: improve validations and documents for watch and unwatch
- debugger: add string validation for watch(expr)
- debugger: add help document for watch(index)
- test: add test for watch(index) command
- doc: add information on unwatch(index) option

PR-URL: https://github.com/nodejs/node/pull/46947
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
2023-03-13 04:29:53 +00:00
Eungyu Lee 7f2ab4e629
debugger: add a command to set which lines to check for context
PR-URL: https://github.com/nodejs/node/pull/46812
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
2023-03-12 04:47:18 +00:00
Abdirahim Musse 5012ab4e86
test: fallback to IPv4 if IPv6 is unavailable
openssl seems to default to use IPv6.
This change adds a checks if IPv6 is unavailable and uses IPv4 instead.
On the Node.js CI IBM i build system IPv6 is currently disabled.
This change should resolve the following test case failures:
- https://ci.nodejs.org/job/node-test-commit-ibmi/nodes=ibmi73-ppc64/1085/testReport/(root)/test/sequential_test_tls_psk_client_/
- https://ci.nodejs.org/job/node-test-commit-ibmi/nodes=ibmi73-ppc64/1085/testReport/(root)/test/sequential_test_tls_securepair_client_/

PR-URL: https://github.com/nodejs/node/pull/47017
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2023-03-11 06:26:25 +00:00
ywave620 7a37829ccb
src: fix cb scope bugs involved in termination
Be more aggresive to clean up the async id stack,
and ensure the cleanup when terminating.

Calling SetIdle() when terminating is not harmless.
When node terminates due to an unhandled exception,
v8 preseves the vm state, which is JS and notifies
node through PerIsolateMessageListener(). If node
calls SetIdle() later, v8 complains because it
requires the vm state to either be EXTERNEL or IDLE
when embedder calling SetIdle().

PR-URL: https://github.com/nodejs/node/pull/45596
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2023-02-28 03:17:46 +00:00
Debadree Chatterjee 5b5898ac86
lib,src: update exit codes as per todos
Refs: https://github.com/nodejs/node/pull/44746
PR-URL: https://github.com/nodejs/node/pull/45841
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2023-02-26 17:03:06 +00:00
James M Snell 950cec4c26 src: update Blob implementation to use DataQueue / File-backed Blobs
Co-authored-by: flakey5 <73616808+flakey5@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/45258
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2023-02-19 16:26:58 -08:00
Deokjin Kim 88d71dc301
lib: refactor to use min/max of `validateNumber`
Fix NumberIsNaN is called two times and change error code
to ERR_OUT_OF_RANGE when RangeError is occurred in test.

PR-URL: https://github.com/nodejs/node/pull/45772
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2023-02-03 21:12:05 +00:00
Ben Noordhuis 3700d9edf7
src: fix c++ exception on bad command line arg
Replace stoull() with strtoull(). The former throws an exception when
the input is malformed, the latter doesn't.

Fixes: https://github.com/nodejs/node/issues/46223
PR-URL: https://github.com/nodejs/node/pull/46290
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-01-22 10:39:16 +00:00
Deokjin Kim d8014f6aa9 test: use `os.availableParallelism()`
Refs: https://github.com/nodejs/node/pull/45895
PR-URL: https://github.com/nodejs/node/pull/46003
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2023-01-11 20:07:56 +00:00
Joyee Cheung 995440b791
bootstrap: make CJS loader snapshotable
This patch makes the top-level access to runtime states in the
CJS loader lazy, and move the side-effects into a
initializeCJS() function that gets called during pre-execution.
As a result the CJS loader can be included into the built-in
snapshot.

PR-URL: https://github.com/nodejs/node/pull/45849
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-12-16 12:44:14 +01:00
Debadree Chatterjee 79a977ae31
watch: add CLI flag to preserve output
Fixes: https://github.com/nodejs/node/issues/45713
PR-URL: https://github.com/nodejs/node/pull/45717
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2022-12-11 23:23:11 +01:00
Stefan Stojanovic 89502401bf
test: fix test-watch-mode
Refs: https://github.com/nodejs/node/issues/44898
PR-URL: https://github.com/nodejs/node/pull/45585
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-12-01 20:10:46 +00:00
Stefan Stojanovic 2cad517854
test: fix test-watch-mode-inspect
Refs: https://github.com/nodejs/node/issues/44898
PR-URL: https://github.com/nodejs/node/pull/45586
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-12-01 18:33:00 +00:00
Moshe Atlow ce16bf553f
watch: watch for missing dependencies
PR-URL: https://github.com/nodejs/node/pull/45348
Reviewed-By: Ruy Adorno <ruyadorno@google.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Nitzan Uziely <linkgoron@gmail.com>
2022-11-13 15:13:26 +00:00
Joyee Cheung b872d30d19
lib: add options to the heap snapshot APIs
Support configuration of the HeapSnapshotMode and NumericsMode
fields inf HeapSnapshotOptions in the JS APIs for heap snapshots.

PR-URL: https://github.com/nodejs/node/pull/44989
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2022-11-08 16:19:54 +01:00
Luke Karrys 590cf569fe
test: convert test-debugger-pid to async/await
PR-URL: https://github.com/nodejs/node/pull/45179
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-11-01 05:45:47 +00:00
Yagiz Nizipli 17ae2ab750
fs: add recursive watch to linux
PR-URL: https://github.com/nodejs/node/pull/45098
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-31 23:15:45 +00:00
Moshe Atlow 47b63f52a8
test: watch mode inspect restart repeatedly
PR-URL: https://github.com/nodejs/node/pull/45060
Fixes: https://github.com/nodejs/node/issues/44805
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-22 18:02:09 +00:00
Pierrick Bouvier 806ea92e70
test: mark test-watch-mode* as flaky on all platforms
This was confirmed flaky on those platforms:
- Windows x64
- Windows on Arm
- Linux
- Freebsd

Tests randomly fail because of bad order in messages expected, which
seems related to threads scheduling at execution.

PR-URL: https://github.com/nodejs/node/pull/45049
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-20 09:06:09 +00:00
Rich Trott 6059cbedbd
test: remove unnecessary noop function args to mustCall()
PR-URL: https://github.com/nodejs/node/pull/45027
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-10-18 12:13:41 +00:00
Madhuri fe520f80c9
test: refactor promises to async/await
PR-URL: https://github.com/nodejs/node/pull/44980
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2022-10-14 17:50:32 +00:00
Moshe Atlow 0298b7f8a6
test: debug watch mode inspect
PR-URL: https://github.com/nodejs/node/pull/44861
Refs: https://github.com/nodejs/node/issues/44805
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-10 16:46:34 +00:00
legendecas 364c0e196c
perf_hooks: fix webperf idlharness
1. Enforce receiver checks on IDL interfaces.
2. Avoid prototype manipulation on constructing IDL interfaces with
   `ReflectConstruct`.
3. `defineReplaceableAttribute` should create IDL getter/setter.
4. Corrected `PerformanceResourceTiming` to inherit the public interface
   `PerformanceEntry` instead of the internal interface
   `InternalPerformanceResourceTiming`.
5. `detail` is not a specified attribute on `PerfomanceEntry`. Node.js
   specific extensions are moved to a subclass of `PerformanceEntry` as
   `PerformanceNodeEntry`.

PR-URL: https://github.com/nodejs/node/pull/44483
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-04 00:55:58 +08:00
Richard Lau 0ee6643d36
test: check server status in test-tls-psk-client
Add assertions to sequential/test-tls-psk-client to check if the
spawned OpenSSL server has exited in any way except for the expected
termination by the cleanUp() function. The added assertions will
prevent the test from spinning forever trying to connect to the
non-existent server in the case that the spawned process has exited.
Include stderr and stdout in the assertion failure message to aid
debugging.

PR-URL: https://github.com/nodejs/node/pull/44824
Refs: https://github.com/nodejs/node/issues/44821
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-02 13:10:37 +00:00
pete3249 bf0c312893
test: use async/await in test-debugger-exceptions
PR-URL: https://github.com/nodejs/node/pull/44690
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-30 02:46:02 +00:00
Chandana e236af8d54
test: use async/await in test-debugger-help
PR-URL: https://github.com/nodejs/node/pull/44686
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-29 23:29:11 +00:00
mmeenapriya 29c35ea823
test: update test-debugger-scripts to use await/async
PR-URL: https://github.com/nodejs/node/pull/44692
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-29 21:32:34 +00:00
Monu-Chaudhary 6b9253a81a test: use async/await in test-debugger-random-port-with-inspect-port
PR-URL: https://github.com/nodejs/node/pull/44695
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-29 12:53:11 -07:00
Brinda Ashar 865a5784fd test: use async/await in test-debugger-heap-profiler
PR-URL: https://github.com/nodejs/node/pull/44693
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-29 12:50:11 -07:00
samyuktaprabhu 2615d7653c test: use async/await in test-debugger-auto-resume
PR-URL: https://github.com/nodejs/node/pull/44675
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-29 07:22:09 -07:00
Rathi N Das 746d525837
test: migrated from Promise chains to Async/Await
PR-URL: https://github.com/nodejs/node/pull/44674
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2022-09-29 09:15:32 +00:00
Juliet Zhang 19503e7468
test: change promises to async/await in test-debugger-backtrace.js
PR-URL: https://github.com/nodejs/node/pull/44677
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2022-09-29 09:15:22 +00:00
Hope Olaidé 6355cd8542
test: use async/await in test-debugger-sb-before-load
PR-URL: https://github.com/nodejs/node/pull/44697
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2022-09-29 09:15:10 +00:00
Divya Mohan 1438557062
test: refactor to async/await
PR-URL: https://github.com/nodejs/node/pull/44694
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-28 16:18:53 +00:00
Priya Shastri 11b8b99ce4
test: modify test-debugger-custom-port.js to use async-await
PR-URL: https://github.com/nodejs/node/pull/44680
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-27 19:35:41 +00:00
Archana Kamath 1d2f1eceef
test: update test-debugger-breakpoint-exists.js to use async/await
PR-URL: https://github.com/nodejs/node/pull/44682
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-27 16:52:39 +00:00
poorvitusam 0098af1e37
test: use async/await in test-debugger-preserve-breaks
PR-URL: https://github.com/nodejs/node/pull/44696
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-27 16:52:30 +00:00
surbhirjain b376047236
test: use async/await in test-debugger-profile
PR-URL: https://github.com/nodejs/node/pull/44684
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-27 16:32:41 +00:00
Ankita Khiratkar 97959769fd
test: change the promises to async/await in test-debugger-exec-scope.js
PR-URL: https://github.com/nodejs/node/pull/44685
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-27 06:26:58 +00:00
Madhulika Sharma 1e6153c090
test: change promises to async/await
PR-URL: https://github.com/nodejs/node/pull/44683
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-26 06:19:11 +00:00
Nupur Chauhan cf4a334050
test: use async/await in test-debugger-invalid-args
PR-URL: https://github.com/nodejs/node/pull/44678
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-25 23:15:27 +00:00
Meghana Ramesh d8493c4f97
test: update test-debugger-low-level to use await/async
PR-URL: https://github.com/nodejs/node/pull/44688
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-25 17:00:58 +00:00
Moshe Atlow dc4398c9cf
test: fix watch mode test flake
PR-URL: https://github.com/nodejs/node/pull/44739
Fixes: https://github.com/nodejs/node/issues/44735
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2022-09-25 11:07:56 +00:00
“Pooja 269aa6ebba test: change promise to async/await in debugger-watcher
PR-URL: https://github.com/nodejs/node/pull/44687
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2022-09-23 06:42:13 -07:00