Commit Graph

15457 Commits

Author SHA1 Message Date
Robert Nagy
3800d60c66 buffer: throw when writing beyond buffer"
This reverts commit dd8eeec3f0.

PR-URL: https://github.com/nodejs/node/pull/54588/
Refs: https://github.com/nodejs/node/pull/54524
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-28 08:21:43 -07:00
Giovanni
e1d8b4f038 assert: show the diff when deep comparing data with a custom message
Fixes: https://github.com/nodejs/node/issues/48465
PR-URL: https://github.com/nodejs/node/pull/54759
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-28 08:11:05 -07:00
Colin Ihrig
e32521a7b9
test_runner: close and flush destinations on forced exit
This commit updates the test runner to explicitly close and flush
all destination file streams when the --test-force-exit flag is
used.

Fixes: https://github.com/nodejs/node/issues/54327
PR-URL: https://github.com/nodejs/node/pull/55099
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-09-28 13:59:06 +00:00
Nathan Baulch
28c7394319
test: fix typos
PR-URL: https://github.com/nodejs/node/pull/55063
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-28 13:58:55 +00:00
Aviv Keller
bf11e5793b
test_runner: support custom arguments in run()
PR-URL: https://github.com/nodejs/node/pull/55126
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-09-28 13:52:04 +00:00
Jason Zhang
7fe5bcd29e
fs: check subdir correctly in cpSync
PR-URL: https://github.com/nodejs/node/pull/55033
Fixes: https://github.com/nodejs/node/issues/54285
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2024-09-28 13:50:53 +00:00
Aviv Keller
2d77ba5d30
Revert "console: colorize console error and warn"
This reverts commit a833c9e0be.

PR-URL: https://github.com/nodejs/node/pull/54677
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2024-09-28 13:50:39 +00:00
Carlos Espa
f5d454ac7e
src: add receiver to fast api callback methods
When creating an fast api the callback might use the receiver. In that
case if the internal binding is destructured the method won't have
access to the reciver and it will throw. Passing the receiver as second
argument ensures the receiver is available.

PR-URL: https://github.com/nodejs/node/pull/54408
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2024-09-28 09:46:03 +00:00
Jason Zhang
87a79cd8a1
stream: treat null asyncIterator as undefined
According to the spec, getIterator should normalize incoming method to
undefined if it is either undefined or null. This PR enforces that spec
compliance with passed WPT.

PR-URL: https://github.com/nodejs/node/pull/55119
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Mattias Buelens <mattias@buelens.com>
2024-09-27 14:34:11 +00:00
Antoine du Hamel
fb852798dc
esm: do not interpret "main" as a URL
As documented, its value is a path.

PR-URL: https://github.com/nodejs/node/pull/55003
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-09-27 10:05:50 +00:00
Christos Koutsiaris
fbc6fcb018
test: remove duplicated test descriptions
PR-URL: https://github.com/nodejs/node/pull/54140
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-09-27 10:05:33 +00:00
RedYetiDev
772b35bdc4
module: support loading entrypoint as url
Co-Authored-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/54933
Refs: https://github.com/nodejs/node/pull/49975
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-09-27 15:26:48 +08:00
jakecastelli
66a2cb210a
test: deflake test/pummel/test-timers.js
PR-URL: https://github.com/nodejs/node/pull/55098
Fixes: https://github.com/nodejs/node/issues/55092
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-09-27 06:16:20 +00:00
Chengzhong Wu
84966703e0
src: track BaseObjects with an efficient list
PR-URL: https://github.com/nodejs/node/pull/55104
Refs: https://github.com/nodejs/node/pull/54880
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2024-09-26 18:40:33 +01:00
Node.js GitHub Bot
5f78e2c880
deps: update timezone to 2024b
PR-URL: https://github.com/nodejs/node/pull/55056
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2024-09-26 16:26:59 +00:00
Joyee Cheung
06206af181
module: unflag --experimental-require-module
This unflags --experimental-require-module so require(esm) can be
used without the flag. For now, when require() actually encounters
an ESM, it will still emit an experimental warning. To opt out
of the feature, --no-experimental-require-module can be used.

There are some tests specifically testing ERR_REQUIRE_ESM. Some
of them are repurposed to test --no-experimental-require-module.
Some of them are modified to just expect loading require(esm) to
work, when it's appropriate.

PR-URL: https://github.com/nodejs/node/pull/55085
Refs: https://github.com/nodejs/node/issues/52697
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2024-09-26 14:21:37 +00:00
Khafra
17fd32790a
buffer: make File cloneable
Fixes: https://github.com/nodejs/node/issues/47612
PR-URL: https://github.com/nodejs/node/pull/47613
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-26 08:24:39 +00:00
Khafra
da5887d8e9
buffer: extract Blob's .arrayBuffer() & webidl changes
- Extracts Blob.prototype.arrayBuffer so it cannot be
  overridden in .text(), etc.
- Make .bytes() enumerable. I guess the WPT runner is
  not running the idlharness tests?
- Make .text() return a Promise, rather than being
  explicitly async. This is a non-documented part of
  the webidl spec. Refs: #49936
- Have .text(), .arrayBuffer(), and .bytes() reject
  for an invalid this instead of throwing. Fix the
  tests regarding this.

PR-URL: https://github.com/nodejs/node/pull/53372
Refs: https://github.com/nodejs/node/pull/49936
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
2024-09-26 05:53:58 +00:00
Luigi Pinca
9bb6a1a790
test: deflake test-http-remove-header-stays-removed
Instead of relying on a timer, verify that `socket.end()` is called when
the `'finish'` event is emitted on the `ServerResponse` object.

PR-URL: https://github.com/nodejs/node/pull/55004
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-09-26 02:59:29 +00:00
Michael Dawson
0f7bdcc17f
test: fix test-tls-junk-closes-server
Refs: https://github.com/nodejs/node/issues/53382

TLS spec seems to indicate there should should be a response
sent when TLS handshake fails. See
https://datatracker.ietf.org/doc/html/rfc8446#page-85

When compiled with OpenSSL32 we see the
the following response '15 03 03 00 02 02 16' which
decodes as a fatal (0x02) TLS error alert number 22 (0x16).
which corresponds to TLS1_AD_RECORD_OVERFLOW which matches
the error we see if NODE_DEBUG is turned on once you get
through the define aliases.

If there is a response from the server the test used to
hang because the end event will not be emitted until after
the response is consumed. This PR fixes the test so
it consumes the response.

Some earlier OpenSSL versions did not seem to send a response but
the error handling seems to have been re-written/improved
in OpenSSL32.

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/55089
Refs: https://github.com/nodejs/node/issues/52482
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jithil P Ponnan <jithil@outlook.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-09-25 21:28:05 +00:00
Antoine du Hamel
2118e32d9b
test: fix more tests that fail when path contains a space
PR-URL: https://github.com/nodejs/node/pull/55088
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-25 21:27:50 +00:00
Antoine du Hamel
bdddc04dff
test: fix assertSnapshot when path contains a quote
PR-URL: https://github.com/nodejs/node/pull/55087
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2024-09-25 19:42:12 +00:00
Antoine du Hamel
aac8ba7bd7
test_runner: fix mocking modules with quote in their URL
PR-URL: https://github.com/nodejs/node/pull/55083
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tierney Cyren <hello@bnb.im>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2024-09-25 17:34:58 +00:00
Antoine du Hamel
7d0ce254e8
test: fix some tests when path contains %
Tests should pass even if the path where the repo is cloned contains
URL-significant chars.

PR-URL: https://github.com/nodejs/node/pull/55082
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
2024-09-25 17:25:33 +00:00
Luigi Pinca
61ad74fb0f
Revert "test: mark test-fs-watch-non-recursive flaky on Windows"
This reverts commit 2a871df3df.

It has been almost three years since the test was marked flaky. Remove
the unstable designation to see if the problem persists on Windows.

Fixes: https://github.com/nodejs/node/issues/40728
PR-URL: https://github.com/nodejs/node/pull/55079
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
2024-09-25 13:18:52 +00:00
Aviv Keller
5c22d19f44
lib, tools: remove duplicate requires
PR-URL: https://github.com/nodejs/node/pull/54987
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-09-25 08:51:28 +00:00
Aviv Keller
c6d20a034d
repl: catch \v and \r in new-line detection
PR-URL: https://github.com/nodejs/node/pull/54512
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-09-25 08:51:11 +00:00
Joyee Cheung
0b9249e335
module: implement the "module-sync" exports condition
This patch implements a "module-sync" exports condition
for packages to supply a sycnrhonous ES module to the
Node.js module loader, no matter it's being required
or imported. This is similar to the "module" condition
that bundlers have been using to support `require(esm)`
in Node.js, and allows dual-package authors to opt into
ESM-first only newer versions of Node.js that supports
require(esm) while avoiding the dual-package hazard.

```json
{
  "type": "module",
  "exports": {
    "node": {
      // On new version of Node.js, both require() and import get
      // the ESM version
      "module-sync": "./index.js",
      // On older version of Node.js, where "module" and
      // require(esm) are not supported, use the transpiled CJS version
      // to avoid dual-package hazard. Library authors can decide
      // to drop support for older versions of Node.js when they think
      // it's time.
      "default": "./dist/index.cjs"
    },
    // On any other environment, use the ESM version.
    "default": "./index.js"
  }
}
```

We end up implementing a condition with a different name
instead of reusing "module", because existing code in the
ecosystem using the "module" condition sometimes also expect
the module resolution for these ESM files to work in CJS
style, which is supported by bundlers, but the native
Node.js loader has intentionally made ESM resolution
different from CJS resolution (e.g. forbidding `import
'./noext'` or `import './directory'`), so it would be
semver-major to implement a `"module"` condition
without implementing the forbidden ESM resolution rules.
For now, this just implments a new condition as semver-minor
so it can be backported to older LTS.

Refs: https://webpack.js.org/guides/package-exports/#target-environment-independent-packages
PR-URL: https://github.com/nodejs/node/pull/54648
Fixes: https://github.com/nodejs/node/issues/52173
Refs: https://github.com/joyeecheung/test-module-condition
Refs: https://github.com/nodejs/node/issues/52697
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-09-25 06:35:26 +00:00
Jason Zhang
0e52836c35
stream: set stream prototype to closest transferable superclass
PR-URL: https://github.com/nodejs/node/pull/55067
Fixes: https://github.com/nodejs/node/issues/54603
Refs: https://github.com/nodejs/node/pull/50107
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2024-09-24 21:18:29 +00:00
Aviv Keller
574f2dd517
lib: prefer optional chaining
PR-URL: https://github.com/nodejs/node/pull/55045
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2024-09-24 19:48:15 +00:00
Luke Taher
04750afb1e
perf_hooks: add missing type argument to getEntriesByName
Fixes: https://github.com/nodejs/node/issues/54766
PR-URL: https://github.com/nodejs/node/pull/54767
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-09-24 19:39:51 +00:00
Pietro Marchini
02e8972169
test: remove interval and give more time to unsync
PR-URL: https://github.com/nodejs/node/pull/55006
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-09-24 14:40:20 +00:00
Luigi Pinca
3c5ceff85f
test: deflake test-inspector-strip-types
Use the `NodeRuntime.waitingForDebugger` event.

Refs: https://github.com/nodejs/node/pull/51560
PR-URL: https://github.com/nodejs/node/pull/55058
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-09-24 05:53:45 +00:00
Yagiz Nizipli
76edde5cd0
lib: remove lib/internal/idna.js
PR-URL: https://github.com/nodejs/node/pull/55050
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2024-09-23 19:33:43 +00:00
Aviv Keller
c237eabf4c
process: remove process.assert
PR-URL: https://github.com/nodejs/node/pull/55035
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-23 16:29:23 +00:00
Filip Skokan
b64006c0ed
crypto: ensure invalid SubtleCrypto JWK data import results in DataError
PR-URL: https://github.com/nodejs/node/pull/55041
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2024-09-23 15:28:44 +00:00
Aviv Keller
4f881790e9
test_runner: report error on missing sourcemap source
Co-Authored-By: Jayden Seric <me@jaydenseric.com>
Co-Authored-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/55037
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2024-09-23 00:32:06 +00:00
Aviv Keller
8b70e6bdee
test: make test-runner-assert more robust
PR-URL: https://github.com/nodejs/node/pull/55036
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2024-09-22 22:27:36 +00:00
Michael Dawson
2cec716c48
test: update tls test to support OpenSSL32
Refs: https://github.com/nodejs/node/issues/53382

OpenSSL32 does not support AES128 and DH 1024 to
update test to use newer algorithms.

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/55030
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-22 14:01:20 +00:00
Filip Skokan
0e187e4a21
test,crypto: update WebCryptoAPI WPT
PR-URL: https://github.com/nodejs/node/pull/55029
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-22 13:52:56 +00:00
Antoine du Hamel
1fcb128771
test: do not assume process.execPath contains no spaces
We had a bunch of tests that would fail if run from an executable that
contains any char that should be escaped when run from a shell.

PR-URL: https://github.com/nodejs/node/pull/55028
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-22 13:03:30 +00:00
Antoine du Hamel
7ecc48d061
test: fix test-vm-context-dont-contextify when path contains a space
Because of the double encoding, the test would fail as soon as the path
contains a space or any other char that's already encoded by
`pathToFileURL`.

PR-URL: https://github.com/nodejs/node/pull/55026
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-22 10:01:41 +00:00
Michael Dawson
cfe58cfdc4
test: adjust tls-set-ciphers for OpenSSL32
Refs: https://github.com/nodejs/node/issues/53382

The test failed as it was using AES128 which is not supported
in OpenSSL32 due to default security level and because
some error messages have changed.

Adjusted to use AES256 where it made sense and not run
tests on OpenSSL32 where test was specific to AES128.

Adjust to use the expected error messages based on version.

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/55016
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-21 19:10:51 +00:00
Colin Ihrig
059e08bb21
test_runner: add 'test:summary' event
This commit adds a new 'test:summary' event to the test runner's
reporting interface. This new event serves two purposes:

- In the future, the test runner internals will no longer need to
  change the process exit code. This may be important to run()
  users. Unfortunately, this is a breaking change, so it needs to
  be changed in a major version.
- The reporting interface now has a single event that can identify
  passing or failing test runs.

Refs: https://github.com/nodejs/node/issues/53867
Refs: https://github.com/nodejs/node/issues/54812
PR-URL: https://github.com/nodejs/node/pull/54851
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-21 17:41:52 +00:00
RedYetiDev
b264cbe5e8 test_runner: use test: symbol on second print of parent test
PR-URL: https://github.com/nodejs/node/pull/54956
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-21 09:38:31 -07:00
Yagiz Nizipli
12dd4c7575 src: mark node --run as stable
PR-URL: https://github.com/nodejs/node/pull/53763
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Ruy Adorno <ruy@vlt.sh>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-21 09:29:47 -07:00
RedYetiDev
941635473d test: add util.stripVTControlCharacters test
PR-URL: https://github.com/nodejs/node/pull/54865
Refs: https://github.com/chalk/ansi-regex/pull/58
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-21 09:27:59 -07:00
Aviv Keller
b23d1c37b9 test: improve coverage for timer promises schedular
PR-URL: https://github.com/nodejs/node/pull/53370
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-21 09:22:17 -07:00
RedYetiDev
a65e4418e5 test: remove getCallSite from common
PR-URL: https://github.com/nodejs/node/pull/54947
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-21 09:20:11 -07:00
Jason Zhang
77ca5ca075 fs: convert to u8 string for filesystem path
PR-URL: https://github.com/nodejs/node/pull/54653
Fixes: https://github.com/nodejs/node/issues/54476
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-21 09:13:19 -07:00
RedYetiDev
5116578b8a test: remove unused common utilities
PR-URL: https://github.com/nodejs/node/pull/54825
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-09-21 09:11:17 -07:00
Khafra
a9081b5391 events: allow null/undefined eventInitDict
PR-URL: https://github.com/nodejs/node/pull/54643
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-21 09:08:39 -07:00
jazelly
d473606040 lib: propagate aborted state to dependent signals before firing events
PR-URL: https://github.com/nodejs/node/pull/54826
Fixes: https://github.com/nodejs/node/issues/54466
Fixes: https://github.com/nodejs/node/issues/54601
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-21 09:07:08 -07:00
Luigi Pinca
a9677db91b test: deflake test-http-header-overflow
Skip the network and push the data directly to the receiving socket
so that it is guaranteed to be received as a single chunk.

Fixes: https://github.com/nodejs/node/issues/46291
PR-URL: https://github.com/nodejs/node/pull/54978
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-21 09:01:26 -07:00
Pietro Marchini
0c8c107aaa
test_runner: replace ansi clear with ansi reset
PR-URL: https://github.com/nodejs/node/pull/55013
Fixes: https://github.com/nodejs/node/issues/55009
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-09-21 13:42:14 +00:00
Omer Katz
4f1fe8a015
cli: remove deprecated V8 flag
Remove the `--huge-max-old-generation-size` V8 flag from the
`NODE_OPTIONS` allowlist. That flag was recently deprecated (it
currently remains as nop, see crrev.com/c/5831467) and will soon be
completely removed.

PR-URL: https://github.com/nodejs/node/pull/54761
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2024-09-21 10:53:28 +02:00
Aviv Keller
9be0057859
test: fix soucre to source
PR-URL: https://github.com/nodejs/node/pull/55038
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-09-21 08:27:56 +00:00
Michael Dawson
29b9c72b05 test: add asserts to validate test assumptions
Refs: https://github.com/nodejs/node/pull/54968
Refs: https://github.com/nodejs/node/issues/53382

Add additional asserts as suggestd by Richard in:
https://github.com/nodejs/node/pull/54968

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/54997
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-09-20 17:48:57 -04:00
Joyee Cheung
62383cd113 module: implement flushCompileCache()
This implements an API for users to intentionally flush the
accumulated compile cache instead of waiting until process
shutdown. It may be useful for application that loads dependencies
first and then either reload itself in other instances, or spawning
other instances that load an overlapping set of its dependencies -
in this case its useful to flush the cache early instead of waiting
until the shutdown of itself.

Currently flushing is triggered by either process
shutdown or user requests. In the future we should simply start the
writes right after module loading on a separate thread, and this method
only blocks until all the pending writes (if any) on the other thread
are finished. In that case, the off-thread writes should finish long
before any attempt of flushing is made so the method would then only
incur a negligible overhead from thread synchronization.

PR-URL: https://github.com/nodejs/node/pull/54971
Fixes: https://github.com/nodejs/node/issues/54770
Fixes: https://github.com/nodejs/node/issues/54465
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-20 19:05:07 +00:00
Joyee Cheung
4dfed556ba module: throw when invalid argument is passed to enableCompileCache()
PR-URL: https://github.com/nodejs/node/pull/54971
Fixes: https://github.com/nodejs/node/issues/54770
Fixes: https://github.com/nodejs/node/issues/54465
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-20 19:05:06 +00:00
Aviv Keller
f666a1b754
tls: fix 'ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED' typo
Co-Authored-By: Fabian Iwand <mootari@users.noreply.github.com>
PR-URL: https://github.com/nodejs/node/pull/52627
Fixes: https://github.com/nodejs/node/issues/52448
Refs: https://github.com/nodejs/node/pull/23188
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2024-09-20 17:59:22 +00:00
Pietro Marchini
e35299ae62
test: add runner watch mode isolation tests
PR-URL: https://github.com/nodejs/node/pull/54888
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-20 13:41:40 +00:00
Chemi Atlow
f79fd03f41
test_runner: add support for coverage via run()
PR-URL: https://github.com/nodejs/node/pull/53937
Fixes: https://github.com/nodejs/node/issues/53867
Refs: https://github.com/nodejs/node/issues/53924
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-20 13:20:45 +00:00
Aviv Keller
2a1607cc2e
test: fix invalid wasm test
PR-URL: https://github.com/nodejs/node/pull/54935
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-09-20 10:42:59 +00:00
Luigi Pinca
a6ed2148a0
test: move test-http-max-sockets to parallel
PR-URL: https://github.com/nodejs/node/pull/54977
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-09-20 09:57:21 +00:00
Luigi Pinca
636b3432d3
test: remove test-http-max-sockets flaky designation
There is no recent trace of failure for this test.

Fixes: https://github.com/nodejs/node/issues/47116
PR-URL: https://github.com/nodejs/node/pull/54976
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-09-20 09:57:06 +00:00
David Dong
291d90acbc
test: refactor test-whatwg-webstreams-encoding to be shorter
PR-URL: https://github.com/nodejs/node/pull/54569
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2024-09-19 15:26:02 +00:00
Marco Ippolito
bb405210c5
test_runner: support typescript module mocking
PR-URL: https://github.com/nodejs/node/pull/54878
Fixes: https://github.com/nodejs/node/issues/54428
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2024-09-19 13:36:52 +00:00
Antoine du Hamel
be4babb3c2
module: report unfinished TLA in ambiguous modules
PR-URL: https://github.com/nodejs/node/pull/54980
Fixes: https://github.com/nodejs/node/issues/54931
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2024-09-19 10:34:13 +00:00
Antoine du Hamel
6031a4bc7c
worker: handle --input-type more consistently
PR-URL: https://github.com/nodejs/node/pull/54979
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2024-09-19 10:08:50 +00:00
Michael Dawson
6dfa3e46d3
test: adjust key sizes to support OpenSSL32
Refs: https://github.com/nodejs/node/issues/53382

This test fails on OpenSSL32 because it complains the key
being used is too short.

Adjust the key sizes so that they will pass on OpenSSL32 in
addition to other OpenSSL3 versions.

Since the keys are not public key related I don't think the
increase in key size will be too bad in terms of performance so
I've just increased versus guarding for OpenSSL32

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/54972
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-09-18 19:26:45 +00:00
Michael Dawson
f8b7a17146
test: update test to support OpenSSL32
Refs: https://github.com/nodejs/node/issues/53382

This test fails on OpenSSL32 because it complains the key being
used is too short.

It seems to have been missed when the test suite was udpated to have
a Makefile to generate key material as the keys are hard coded in the
test as opposed to being read in from the fixtures/key directory.

Update the test to use keys/certs from the fixtures directory and
to remove newlines at the end of the key and cert to retain the
inteded test.

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/54968
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2024-09-18 16:36:08 +00:00
Pietro Marchini
50136a167d
test_runner: avoid coverage report partial file names
Co-author: Medhansh404 <21ucs126@lnmiit.ac.in>
PR-URL: https://github.com/nodejs/node/pull/54379
Fixes: https://github.com/nodejs/node/issues/51299
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-09-18 18:24:19 +02:00
Khafra
b470e2fcb2
test: update DOM events web platform tests
PR-URL: https://github.com/nodejs/node/pull/54642
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-18 17:39:56 +02:00
Yagiz Nizipli
0c5fa57bc7
cli: ensure --run has proper pwd
PR-URL: https://github.com/nodejs/node/pull/54949
Refs: https://github.com/nodejs/node/pull/53600
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
2024-09-18 12:18:40 +00:00
Andrew Moon
29f31c6a76
crypto: add Date fields for validTo and validFrom
Added equivalent fields to `X509Certificate` in Date form.

PR-URL: https://github.com/nodejs/node/pull/54159
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2024-09-18 00:56:24 +00:00
Joyee Cheung
3c4ef343ee module: remove bogus assertion in CJS entrypoint handling with --import
The synchronous CJS translator can handle entrypoints now, this
can be hit when --import is used, so lift the bogus assertions and
added tests.

PR-URL: https://github.com/nodejs/node/pull/54592
Fixes: https://github.com/nodejs/node/issues/54577
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-09-17 12:28:09 +02:00
Yagiz Nizipli
d5c29ba12d
events: set EventEmitterAsyncResource fields private
PR-URL: https://github.com/nodejs/node/pull/54889
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-09-17 03:55:21 +00:00
Jason Zhang
c1afd2c8e3
fs: translate error code properly in cpSync
UV error code needs to be negative integer so it can be mapped
correctly. The filesystem error are positive integer, so we need to
handle it before throwing.

Co-authored-by: Jake Yuesong Li <jake.yuesong@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/54906
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2024-09-16 12:41:55 +00:00
Bosco Domingo
53ede878a5
src: add --env-file-if-exists flag
Fixes: https://github.com/nodejs/node/issues/50993
Refs: https://github.com/nodejs/node/issues/51451

test: remove unnecessary comment

src: conform to style guidelines

src: change flag to `--env-file-optional`

test: revert automatic linter changes

doc: fix typos

src: change flag to `--env-file-if-exists`

src: refactor `env_file_data` and `GetEnvFileDataFromArgs`

test: clean up tests

src: print error when file not found

test: remove unnecessary extras
PR-URL: https://github.com/nodejs/node/pull/53060
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-09-16 00:58:16 +00:00
Michael Dawson
c77bcf0187
test: adjust test-tls-junk-server for OpenSSL32
Refs: #53382

OpenSSL32 returns different error text. Looking through
the test it seems like the expected error text has been adjusted
for different OpenSSL versions in the past and what the test
is testing is not related to the error being returned.

Update test to allow for error returned by OpenSSL32

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/54926
Refs: https://github.com/nodejs/node/issues/53382
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-09-15 16:40:05 +00:00
Filip Skokan
3da465a815
test,crypto: update WebCryptoAPI WPT
PR-URL: https://github.com/nodejs/node/pull/54925
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-15 16:28:03 +00:00
Aviv Keller
028c586478
test_runner: reimplement assert.ok to allow stack parsing
PR-URL: https://github.com/nodejs/node/pull/54776
Refs: https://github.com/nodejs/help/issues/4461
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2024-09-15 15:53:18 +00:00
Colin Ihrig
dbaef339aa
test_runner: detect only tests when --test is not used
This commit updates the way the test runner processes 'only'
tests when node:test files are run without the --test CLI.
This is a breaking change.

PR-URL: https://github.com/nodejs/node/pull/54881
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-15 14:20:59 +00:00
Shima Ryuhei
86bdca9772
repl: avoid interpreting 'npm' as a command when errors are recoverable
This change ensures that 'npm' within JavaScript code is not mistakenly
interpreted as an npm command when the error is recoverable.
This allows 'npm' to be treated as expected in such scenarios.

Fixes: https://github.com/nodejs/node/issues/54830
PR-URL: https://github.com/nodejs/node/pull/54848
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Kohei Ueno <kohei.ueno119@gmail.com>
2024-09-15 13:25:19 +00:00
Wuli
6db320acbc
test: remove duplicate skip AIX
PR-URL: https://github.com/nodejs/node/pull/54917
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-09-15 07:32:56 +00:00
Michael Dawson
a65105ec28
test: adjust tls test for OpenSSL32
Refs: https://github.com/nodejs/node/issues/53382

Looks like test is forcing an error through bad data and
the error code we get is different for OpenSSL32. Adjust
test to cope with the variation across versions.

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/54909
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-14 16:55:40 +00:00
Hüseyin Açacak
c6f514c7ab
test: fix test-http2-socket-close.js
Fixes: https://github.com/nodejs/node/issues/54819
PR-URL: https://github.com/nodejs/node/pull/54900
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2024-09-14 16:01:56 +00:00
Hüseyin Açacak
efbba60e5b
path: fix bugs and inconsistencies
Fixes: https://github.com/nodejs/node/issues/54025
PR-URL: https://github.com/nodejs/node/pull/54224
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2024-09-14 14:56:31 +00:00
Sunghoon
415905712e
test: improve test-internal-fs-syncwritestream
A subtest about the behavior when `autoClose=false`.

PR-URL: https://github.com/nodejs/node/pull/54671
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-09-14 14:31:13 +00:00
Luigi Pinca
3569493ba7
test: deflake test-dns
Prevent responses from being cached.

Fixes: https://github.com/nodejs/node/issues/54124
PR-URL: https://github.com/nodejs/node/pull/54902
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-14 14:09:11 +00:00
Michael Dawson
c4f2954703
test: fix test test-tls-dhe for OpenSSL32
Refs: https://github.com/nodejs/node/issues/53382

- OpenSSL32 has a minimum dh key size by 2048 by default.
- Adjust test to use larger 3072 key instead of 1024
  when OpenSSL32 is present.

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/54903
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-14 13:25:24 +00:00
Mert Can Altin
75e4d0df8f node-api: add support for UTF-8 and Latin-1 property keys
PR-URL: https://github.com/nodejs/node/pull/52984
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Vladimir Morozov <vmorozov@microsoft.com>
2024-09-13 13:01:52 -07:00
Aviv Keller
b4088f5a53
test: use correct file naming syntax for util-parse-env
PR-URL: https://github.com/nodejs/node/pull/53705
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-09-13 18:45:58 +00:00
Luigi Pinca
a7b0369e96
test: add missing await
Add missing `await` in
`test/parallel/test-inspector-async-stack-traces-promise-then.js`.

PR-URL: https://github.com/nodejs/node/pull/54828
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-13 18:36:02 +00:00
jazelly
05ad947899 http: reduce likelihood of race conditions on keep-alive timeout
Fixes: https://github.com/nodejs/node/issues/52649
Refs: https://github.com/nodejs/node/issues/54293

Co-authored-by: Arrigo Zanette <zanettea@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/54863
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
2024-09-13 08:45:00 -07:00
Aviv Keller
99bbf80608
test_runner: report coverage thresholds in test:coverage
PR-URL: https://github.com/nodejs/node/pull/54813
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2024-09-13 13:31:37 +00:00
Pietro Marchini
e21984b70c
test_runner: update kPatterns
PR-URL: https://github.com/nodejs/node/pull/54728
Fixes: https://github.com/nodejs/node/issues/54726
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-09-13 02:51:35 +00:00
Yagiz Nizipli
59220bb08a
test: move more url tests to node:test
PR-URL: https://github.com/nodejs/node/pull/54636
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2024-09-13 00:29:55 +00:00
Giovanni Bucci
92ca0b7ec1
test: strip color chars in test-runner-run
Fixes: https://github.com/nodejs/node/issues/54551
PR-URL: https://github.com/nodejs/node/pull/54552
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-12 23:13:04 +00:00
cjihrig
f5f67ae4a7
test_runner: detect only tests when isolation is off
This commit updates the way the test runner processes 'only'
tests when process-based test isolation is disabled. The
--test-only flag is no longer necessary in this scenario. The
test runner will automatically detect 'only' tests and apply the
appropriate filtering.

PR-URL: https://github.com/nodejs/node/pull/54832
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-09-12 12:41:11 -04:00
Luigi Pinca
e60caeebda
test: deflake test-http2-misbehaving-multiplex
Fixes: https://github.com/nodejs/node/issues/54859
PR-URL: https://github.com/nodejs/node/pull/54872
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2024-09-12 15:48:13 +00:00
Luigi Pinca
9db6327af3
test: remove dead code in test-http2-misbehaving-multiplex
PR-URL: https://github.com/nodejs/node/pull/54860
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2024-09-12 05:47:53 +00:00
Luigi Pinca
e48df8d64b
test: reduce test-esm-loader-hooks-inspect-wait flakiness
Refs: https://github.com/nodejs/node/pull/51560
PR-URL: https://github.com/nodejs/node/pull/54827
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-12 05:47:44 +00:00
James M Snell
4b2cab29a5 test: reduce the allocation size in test-worker-arraybuffer-zerofill
Test has been flaky with timeouts in CI. This is possibly due to the
repeated large allocations on the main thread. This commit reduces the
allocation size and makes a number of other cleanups. The main goal
is to hopefully make this test more reliable / not-flaky.

Also move the test to sequential. The frequent large allocations
could be causing the test to be flaky if run parallel to other tests.

PR-URL: https://github.com/nodejs/node/pull/54839
Refs: https://github.com/nodejs/node/issues/52274
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-11 22:22:33 -07:00
Michael Dawson
d9ca8b018e test: fix test-tls-client-mindhsize for OpenSSL32
Refs: https://github.com/nodejs/node/issues/53382

- OpenSSL32 has a minimum dh key size by 2048 by
  default.
- Create larter 3072 dh key needed for testing and
  adjust tests to use it for builds with OpenSSL32

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/54739
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-11 22:19:12 -07:00
Yagiz Nizipli
8eb9353b03
test: remove need to make fs call for zlib test
PR-URL: https://github.com/nodejs/node/pull/54814
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-12 05:05:47 +00:00
jakecastelli
780f478d0f test: use platform timeout
PR-URL: https://github.com/nodejs/node/pull/54591
Refs: https://github.com/nodejs/node/issues/54499
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-09-12 09:49:26 +09:30
jakecastelli
a72c964b45 test: add platform timeout support for riscv64
PR-URL: https://github.com/nodejs/node/pull/54591
Refs: https://github.com/nodejs/node/issues/54499
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-09-12 09:49:14 +09:30
James M Snell
37834997ff test: reduce stack size for test-error-serdes
Hopefully reduces the run time and the likelihood of the test
failing with a flaky timeout error.

remove test-error-serdes from flaky list

move test-error-serdes to sequential

PR-URL: https://github.com/nodejs/node/pull/54840
Refs: https://github.com/nodejs/node/issues/52630
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2024-09-11 15:31:23 -07:00
Antoine du Hamel
53cdffea20
esm: throw ERR_REQUIRE_ESM instead of ERR_INTERNAL_ASSERTION
PR-URL: https://github.com/nodejs/node/pull/54868
Fixes: https://github.com/nodejs/node/issues/54773
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-09-11 21:48:02 +00:00
Yagiz Nizipli
cc780ddf1e
test: reduce fs calls in test-fs-existssync-false
PR-URL: https://github.com/nodejs/node/pull/54815
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2024-09-11 21:22:54 +00:00
Aviv Keller
5de919b652 test: use node:test in test-cli-syntax.bad
PR-URL: https://github.com/nodejs/node/pull/54513
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-10 08:50:19 -07:00
James M Snell
22ea302978 test: move test-http-server-request-timeouts-mixed
Test was moved to sequential a while back.

PR-URL: https://github.com/nodejs/node/pull/54841
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-09-10 07:19:41 -07:00
Antoine du Hamel
2ef33af16e
esm: fix support for URL instances in import.meta.resolve
PR-URL: https://github.com/nodejs/node/pull/54690
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: LiviaMedeiros <livia@cirno.name>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-10 01:00:33 +02:00
Aviv Keller
5c8d0ebf30
test_runner: allow --import with no isolation
Co-Authored-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/54697
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-09-10 00:51:36 +02:00
Anna Henningsen
c3a7b29e56 tls: add allowPartialTrustChain flag
This commit exposes the `X509_V_FLAG_PARTIAL_CHAIN` OpenSSL flag to
users. This is behavior that has been requested repeatedly in the
Github issues, and allows aligning behavior with other TLS libraries
and commonly used applications (e.g. `curl`).

As a drive-by, simplify the `SecureContext` source by deduplicating
call sites at which a new custom certificate store was created for the
`secureContext` in question.

Fixes: https://github.com/nodejs/node/issues/36453
PR-URL: https://github.com/nodejs/node/pull/54790
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-09 17:24:10 +02:00
Stephen Belanger
e1e312d7f0
test: fix Windows async-context-frame memory failure
PR-URL: https://github.com/nodejs/node/pull/54823
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2024-09-08 14:21:18 +00:00
Daeyeon Jeong
eab9729d16
src: fix unhandled error in structuredClone
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/54764
Fixes: https://github.com/nodejs/node/issues/54602
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-07 23:05:00 +00:00
Khafra
6c85d40593
esm: use Undici/fetch data: URL parser
Fixes: https://github.com/nodejs/node/issues/53775
PR-URL: https://github.com/nodejs/node/pull/54748
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-07 10:22:03 +02:00
James M Snell
dcc2ed944f src: move hkdf, scrypto, pbkdf2 impl to ncrypto
PR-URL: https://github.com/nodejs/node/pull/54651
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2024-09-06 19:44:26 -07:00
Yagiz Nizipli
16e6747c35 test: set test-http2-socket-close as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:42 -07:00
Yagiz Nizipli
6d5a94b344 test: set test-worker-arraybuffer-zerofill as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:41 -07:00
Yagiz Nizipli
1612f60161 test: set test-runner-run-watch as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:39 -07:00
Yagiz Nizipli
c45b7ec192 test: set test-http-server-request-timeouts-mixed as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:38 -07:00
Yagiz Nizipli
67ccb3af17 test: set test-single-executable-application-empty as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:36 -07:00
Yagiz Nizipli
b002b62c95 test: set test-macos-app-sandbox as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:35 -07:00
Yagiz Nizipli
cfb128a2d9 test: set test-fs-utimes as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:33 -07:00
Yagiz Nizipli
f26c9bd3bc test: set test-runner-run-watch as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:32 -07:00
Yagiz Nizipli
8ed9d54dfa test: set test-sqlite-statement-sync as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:30 -07:00
Yagiz Nizipli
e5c8978222 test: set test-writewrap as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:29 -07:00
Yagiz Nizipli
407b61cec3 test: set test-async-context-frame as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:27 -07:00
Yagiz Nizipli
de238274d3 test: set test-esm-loader-hooks-inspect-wait as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:25 -07:00
Yagiz Nizipli
9c6d6de828 test: set test-http2-large-file as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:24 -07:00
Yagiz Nizipli
affd1ced67 test: set test-runner-watch-mode-complex as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:22 -07:00
Yagiz Nizipli
866d32ffcd test: set test-performance-function as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:21 -07:00
Yagiz Nizipli
c4c580bfd5 test: set test-debugger-heap-profiler as flaky
PR-URL: https://github.com/nodejs/node/pull/54802
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2024-09-06 17:02:19 -07:00
Huáng Jùnliàng
18101d83a1
crypto: reject dh,x25519,x448 in {Sign,Verify}Final
Fixes: https://github.com/nodejs/node/issues/53742
PR-URL: https://github.com/nodejs/node/pull/53774
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2024-09-06 22:07:16 +00:00
Jason Zhang
973144b7c6
lib: convert signals to array before validation
Co-authored-by: Jake Yuesong Li <jake.yuesong@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/54714
Fixes: https://github.com/nodejs/node/issues/54674
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matthew Aitken <maitken033380023@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-09-06 17:40:21 +00:00
Jason Zhang
1c67899ffb
buffer: fix out of range for toString
Co-authored-by: Michaël Zasso <targos@protonmail.com>
PR-URL: https://github.com/nodejs/node/pull/54553
Fixes: https://github.com/nodejs/node/issues/52298
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-09-06 17:39:24 +00:00
Antoine du Hamel
a75e3dff7e
test: fix test-process-load-env-file when path contains '
If the repo is cloned on a path that contains a quote, the test should
not fail.

PR-URL: https://github.com/nodejs/node/pull/54511
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-06 17:38:42 +00:00
Santiago Gimeno
b345118e1e
test: refactor fs-watch tests due to macOS issue
In `macOS`, fsevents generated immediately before start watching may
leak into the event callback. See: https://github.com/nodejs/node/issues/54450
for an explanation. This might be fixed at some point in `libuv` though
it may take some time (see: https://github.com/libuv/libuv/issues/3866).
This commit comes in anticipation of the soon-to-be-released
`libuv@1.49.0` which was making these tests very flaky.

PR-URL: https://github.com/nodejs/node/pull/54498
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-09-06 17:38:28 +00:00
Giovanni Bucci
e4fdd0b492
test: refactor test-esm-type-field-errors
Co-Authored-By: Jacob Smith <jacob@frende.me>
PR-URL: https://github.com/nodejs/node/pull/54368
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-06 08:29:26 +00:00
Michael Dawson
ce19715cbb deps: allow amaro to be externalizable
- allow amaro to be externalized like other builtins
  containing WASM. More context is available in
  https://github.com/nodejs/node/blob/main/doc/contributing/maintaining/maintaining-dependencies.md#supporting-externalizable-dependencies-with-javascript-code

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/54646
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-05 14:27:30 -04:00
Tim Perry
65b4fb840e
crypto: return a clearer error when loading an unsupported pkcs12
PR-URL: https://github.com/nodejs/node/pull/54485
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-09-05 14:15:01 +00:00
Jason Zhang
a48852be17
fs: respect dereference when copy symlink directory
Co-authored-by: Jake Yuesong Li <jake.yuesong@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/54732
Fixes: https://github.com/nodejs/node/issues/54730
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-05 13:54:49 +00:00
Robert Nagy
dc74f17f6c
buffer: re-enable Fast API for Buffer.write
Re-enables fast Fast API for Buffer.write after fixing
UTF8 handling.

Fixes: https://github.com/nodejs/node/issues/54521
PR-URL: https://github.com/nodejs/node/pull/54526
Reviewed-By: Daniel Lemire <daniel@lemire.me>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2024-09-04 22:34:29 +00:00
Rafael Gonzaga
80a989f931
lib: add util.getCallSite() API
PR-URL: https://github.com/nodejs/node/pull/54380
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-04 19:47:25 +00:00
Chengzhong Wu
70de19e2cc
vm: add vm proto property lookup test
Add more test coverage on vm prototype properties lookup with
`in` operator and property access.

PR-URL: https://github.com/nodejs/node/pull/54606
Refs: https://github.com/nodejs/node/issues/54436
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-04 10:58:49 +00:00
Giovanni Bucci
03fe00e3da
benchmark: adds groups to better separate benchmarks
Fixes: https://github.com/nodejs/node/issues/26425
Co-Authored-By: Yaman Kassir <mestery@protonmail.com>
PR-URL: https://github.com/nodejs/node/pull/54393
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
2024-09-04 03:26:53 +00:00
Jason Zhang
981c701400
lib: ensure no holey array in fixed_queue
Co-authored-by: Jake Yuesong Li <jake.yuesong@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/54537
Fixes: https://github.com/nodejs/node/issues/54472
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-09-02 01:42:44 +00:00
mscdex
71b36b3068
https: only use default ALPNProtocols when appropriate
PR-URL: https://github.com/nodejs/node/pull/54411
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-09-01 03:04:10 +00:00
Yagiz Nizipli
826b7533e8
test: move more zlib tests to node:test
PR-URL: https://github.com/nodejs/node/pull/54609
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2024-09-01 00:35:18 +00:00
Joyee Cheung
0b120af159
test: improve output of child process utilities
- Display command and options when it fails
- Keep the caller line at the top of the stack trace.

PR-URL: https://github.com/nodejs/node/pull/54622
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
2024-08-30 22:41:04 +00:00
Bryan English
ef6b9ffc8d
async_hooks: add an InactiveAsyncContextFrame class
This gives a class prototype for AsyncContextFrame that contains the
required methods, so that when we swap the prototype,
ActiveAsyncContextFrame methods are used instead. Previously, the
methods were defined in AsyncContextFrame, so swapping the prototype
didn't swap those static methods.

Also, make the ActiveAsyncContextFrame extend from Map.

Fixes: https://github.com/nodejs/node/issues/54503
PR-URL: https://github.com/nodejs/node/pull/54510
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2024-08-30 20:27:28 +00:00
Joyee Cheung
3b0617dd19 vm: migrate ContextifyScript to cppgc
This patch migrates ContextifyScript to cppgc-based memory
management using CppgcMixin.

PR-URL: https://github.com/nodejs/node/pull/52295
Refs: https://github.com/nodejs/node/issues/40786
Refs: https://docs.google.com/document/d/1ny2Qz_EsUnXGKJRGxoA-FXIE2xpLgaMAN6jD7eAkqFQ/edit
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2024-08-30 16:58:31 +00:00
Joyee Cheung
849db10fb3 src: add helpers for creating cppgc-managed wrappers
This patch adds helpers for wrapper classes based on cppgc (Oilpan)
in `src/cppgc_helpers.h`, including `node::CppgcMixin` and
`ASSIGN_OR_RETURN_UNWRAP_CPPGC`, which are designed to have
similar interface to BaseObject helpers to help migration.
They are documented in the `CppgcMixin` section in `src/README.md`

To disambiguate, the global `node::Unwrap<>` has now been moved
as `node::BaseObject::Unwrap<>`, and `node::Cppgc::Unwrap<>`
implements a similar unwrapping mechanism for cppgc-managed
wrappers.

PR-URL: https://github.com/nodejs/node/pull/52295
Refs: https://github.com/nodejs/node/issues/40786
Refs: https://docs.google.com/document/d/1ny2Qz_EsUnXGKJRGxoA-FXIE2xpLgaMAN6jD7eAkqFQ/edit
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2024-08-30 16:58:30 +00:00
Michael Dawson
e9cd4766e3 test: fix test-tls-client-auth test for OpenSSL32
Refs: https://github.com/nodejs/node/issues/53382
Refs: https://github.com/nodejs/node/pull/53384

Same change as in 53384 where OpenSSL32 returns a slightly
different error but for a different test.

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/54610
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-08-30 12:13:18 -04:00
Richard Lau
2bfc9e467c
test: update TLS test for OpenSSL 3.2
Update `parallel/test-tls-set-sigalgs` to account for error code changes
in OpenSSL 3.2 and later.

PR-URL: https://github.com/nodejs/node/pull/54612
Refs: https://github.com/nodejs/node/pull/53384
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2024-08-30 15:40:08 +00:00
Rafael Gonzaga
9a275e15c3
src,lib: add performance.uvMetricsInfo
This commit exposes a new API to the perf_hooks.performance
module. This wraps uv_metrics_info into
performance.uvMetricsInfo() function.

PR-URL: https://github.com/nodejs/node/pull/54413
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2024-08-30 14:22:28 +00:00
Chengzhong Wu
d2479fa020
vm: return all own names and symbols in property enumerator interceptor
Property enumerator methods like `Object.getOwnPropertyNames`,
`Object.getOwnPropertySymbols`, and `Object.keys` all invokes the
named property enumerator interceptor. V8 will filter the result based
on the invoked enumerator variant. Fix the enumerator interceptor to
return all potential properties.

PR-URL: https://github.com/nodejs/node/pull/54522
Refs: https://github.com/jsdom/jsdom/issues/3688
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2024-08-30 11:22:58 +00:00
Michaël Zasso
8966787624
test: run V8 Fast API tests in release mode too
Only keep the call count assertions under `common.isDebug`.

PR-URL: https://github.com/nodejs/node/pull/54570
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-08-30 10:25:01 +00:00
Michael Dawson
01f751b529
test: increase key size for ca2-cert.pem
Refs: https://github.com/nodejs/node/pull/44498
Refs: https://github.com/nodejs/node/issues/53382

Key sizes were increased to 2048 in PR 44498 including
the configuration file for the generation of ca2-cert.pem.
However, it seems like updating ca2-cert.pem and related files
themselves were missed as they were not updated in the PR and
the ca2-cert.pem reported as being associated with a 1024 bit key.
I believe that was the cause of some of the failures mentioned in
https://github.com/nodejs/node/issues/53382 as OpenSSL 3.2
increased the default security level from 1 to 2 and that
would mean that certificates associated with keys of 1024 bits
would no longer be accepted.

This PR updates the key size for ca2-cert.pem. It was not
necessary to change the config, only run the generation for
the ca2-cert.pem and related files.

Signed-off-by: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/54599
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-08-29 23:59:18 +00:00
James M Snell
2bd0f99e77 test: update test-abortsignal-cloneable to use node:test
PR-URL: https://github.com/nodejs/node/pull/54581
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-08-29 16:07:52 -07:00
James M Snell
9cbef482df test: update multiple assert tests to use node:test
PR-URL: https://github.com/nodejs/node/pull/54585
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2024-08-29 11:40:53 -07:00
James M Snell
5060bbfabc test: update test-assert-typedarray-deepequal to use node:test
PR-URL: https://github.com/nodejs/node/pull/54585
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2024-08-29 11:40:51 -07:00
James M Snell
cf1d5c3a32 test: update test-assert to use node:test
PR-URL: https://github.com/nodejs/node/pull/54585
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2024-08-29 11:40:50 -07:00
Filip Skokan
fc02b88f89
test,crypto: update WebCryptoAPI WPT
Refs: #54572
Refs: #54468
PR-URL: https://github.com/nodejs/node/pull/54593
Refs: https://github.com/nodejs/node/issues/54572
Refs: https://github.com/nodejs/node/pull/54468
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-08-29 16:46:40 +00:00
Joyee Cheung
d98cfcc581
vm: introduce vanilla contexts via vm.constants.DONT_CONTEXTIFY
This implements a flavor of vm.createContext() and friends
that creates a context without contextifying its global object.
This is suitable when users want to freeze the context (impossible
when the global is contextified i.e. has interceptors installed)
or speed up the global access if they don't need the interceptor
behavior.

```js
const vm = require('node:vm');

const context = vm.createContext(vm.constants.DONT_CONTEXTIFY);

// In contexts with contextified global objects, this is false.
// In vanilla contexts this is true.
console.log(vm.runInContext('globalThis', context) === context);

// In contexts with contextified global objects, this would throw,
// but in vanilla contexts freezing the global object works.
vm.runInContext('Object.freeze(globalThis);', context);

// In contexts with contextified global objects, freezing throws
// and won't be effective. In vanilla contexts, freezing works
// and prevents scripts from accidentally leaking globals.
try {
  vm.runInContext('globalThis.foo = 1; foo;', context);
} catch(e) {
  console.log(e); // Uncaught ReferenceError: foo is not defined
}

console.log(context.Array);  // [Function: Array]
```

PR-URL: https://github.com/nodejs/node/pull/54394
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-08-29 09:05:03 +00:00
Pietro Marchini
dcf50f15bc
test_runner: ensure test watcher picks up new test files
PR-URL: https://github.com/nodejs/node/pull/54225
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-08-29 08:55:34 +00:00
tannal
0b6b2a4dc7
test: merge ongc and gcutil into gc.js
PR-URL: https://github.com/nodejs/node/pull/54355
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-08-29 08:49:52 +01:00
James M Snell
c44d41b2d8 test: move a couple of tests over to using node:test
PR-URL: https://github.com/nodejs/node/pull/54582
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2024-08-28 19:19:01 -07:00
James M Snell
097dcfcb1f test: update test-aborted-util to use node:test
PR-URL: https://github.com/nodejs/node/pull/54578
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2024-08-28 19:13:53 -07:00
James M Snell
39215e1cfa test: refactor test-abortcontroller to use node:test
Starting the long process of refactoring our own tests to use
the node:test module and mocks.

PR-URL: https://github.com/nodejs/node/pull/54574
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2024-08-28 18:50:53 -07:00
Joyee Cheung
ff5ef7083d
src: add JS APIs for compile cache and NODE_DISABLE_COMPILE_CACHE
This patch adds the following API for tools to enable compile
cache dynamically and query its status.

- module.enableCompileCache(cacheDir)
- module.getCompileCacheDir()

In addition this adds a NODE_DISABLE_COMPILE_CACHE environment
variable to disable the code cache enabled by the APIs as
an escape hatch to avoid unexpected/undesired effects of
the compile cache (e.g. less precise test coverage).

When the module.enableCompileCache() method is invoked without
a specified directory, Node.js will use the value of
the NODE_COMPILE_CACHE environment variable if it's set, or
defaults to `path.join(os.tmpdir(), 'node-compile-cache')`
otherwise. Therefore it's recommended for tools to call this
method without specifying the directory to allow overrides.

PR-URL: https://github.com/nodejs/node/pull/54501
Fixes: https://github.com/nodejs/node/issues/53639
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-08-28 23:22:57 +00:00
Rafael Gonzaga
4a0ec20a35
lib: respect terminal capabilities on styleText
This PR changes styleText API to respect terminal
capabilities and environment variables such as
NO_COLOR, NODE_DISABLE_COLORS, and FORCE_COLOR.

PR-URL: https://github.com/nodejs/node/pull/54389
Fixes: https://github.com/nodejs/node/issues/54365
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2024-08-28 18:00:11 +00:00
jakecastelli
4f14eb1545 Revert "net: validate host name for server listen"
This reverts commit 52322aa42a.

PR-URL: https://github.com/nodejs/node/pull/54554
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-08-28 17:27:19 +09:30
Vladimir Morozov
0b3ae01131
test: fix embedding test for Windows
PR-URL: https://github.com/nodejs/node/pull/53659
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Stefan Stojanovic <stefan.stojanovic@janeasystems.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2024-08-27 21:30:50 +00:00
Vinicius Lourenço
a7271ab47d
lib: fix emit warning for debuglog.time when disabled
PR-URL: https://github.com/nodejs/node/pull/54275
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2024-08-27 16:20:35 +00:00
Colin Ihrig
eb7e18fe94
test_runner: always make spec the default reporter
This is a breaking change. Prior to this commit, the test_runner
defaulted to the spec reporter if using a TTY, and the TAP
reporter otherwise. This commit makes spec the default reporter
unconditionally. TAP output is still available via the
--test-reporter=tap CLI flag.

Fixes: https://github.com/nodejs/node/issues/54540
PR-URL: https://github.com/nodejs/node/pull/54548
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-08-27 15:22:16 +00:00
Marco Ippolito
5e6aab0eca
module: use amaro default transform values
PR-URL: https://github.com/nodejs/node/pull/54517
Fixes: https://github.com/nodejs/node/issues/54514
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
2024-08-27 16:39:09 +02:00
James M Snell
6bf7b6e342 src: move more crypto_dh.cc code to ncrypto
Update deps/ncrypto/ncrypto.cc

PR-URL: https://github.com/nodejs/node/pull/54459
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2024-08-27 07:27:12 -07:00
Robert Nagy
dd8eeec3f0
buffer: truncate instead of throw when writing beyond buffer
Fixes: https://github.com/nodejs/node/issues/54523
Fixes: https://github.com/nodejs/node/issues/54518
PR-URL: https://github.com/nodejs/node/pull/54524
Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-08-27 08:48:52 +00:00
Robert Nagy
c00ea01f2b
buffer: allow invalid encoding in from
Looks like a bug to me but the change should probably
done in a semver majpr.

PR-URL: https://github.com/nodejs/node/pull/54533
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
2024-08-27 04:01:30 +00:00
Colin Ihrig
3d5357a2f4
test: refactor test_runner tests to change default reporter
This commit updates the test runner tests in order to switch the
default reporter from tap to spec. This commit can be backported,
while changing the default reporter cannot.

Refs: https://github.com/nodejs/node/issues/54540
PR-URL: https://github.com/nodejs/node/pull/54547
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-08-27 00:54:22 +00:00
Colin Ihrig
05bd3cfc73
test: force spec reporter in test-runner-watch-mode.mjs
In the CI this test generates TAP output that can confuse the
Python test runner. Avoid the problem by not outputting TAP at
from the spawned child process.

Fixes: https://github.com/nodejs/node/issues/54535
PR-URL: https://github.com/nodejs/node/pull/54538
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-08-26 12:39:36 +00:00
Luigi Pinca
1399d4ea8a
test: use valid hostnames
Use valid hostnames in
`test/sequential/test-net-server-listen-ipv6-link-local.js`.

Refs: https://github.com/nodejs/node/pull/54554
PR-URL: https://github.com/nodejs/node/pull/54556
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2024-08-25 22:16:25 +00:00
Jason Zhang
52322aa42a
net: validate host name for server listen
Fixes: https://github.com/nodejs/node/issues/54441

Co-authored-by: Luigi Pinca <luigipinca@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/54470
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
2024-08-25 12:36:40 +00:00
Michaël Zasso
7fea0108d5
sqlite: return results with null prototype
These objects are dictionaries, and a query can return columns with
special names like `__proto__` (which would be ignored without this
change).

Also construct the object by passing vectors of properties for better
performance and improve error handling by using `MaybeLocal`.

PR-URL: https://github.com/nodejs/node/pull/54350
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-08-25 10:43:17 +00:00
Paolo Insogna
6d654ddd00
timers: fix validation
PR-URL: https://github.com/nodejs/node/pull/54404
Reviewed-By: Claudio Wunder <cwunder@gnome.org>
2024-08-25 07:30:10 +00:00
Antoine du Hamel
4e68b541fd
test: fix improper path to URL conversion
PR-URL: https://github.com/nodejs/node/pull/54509
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-08-24 20:10:11 +00:00
Pietro Marchini
bec3425d0c
test: add tests for runner coverage with different stdout column widths
PR-URL: https://github.com/nodejs/node/pull/54494
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2024-08-24 12:30:27 +00:00
Aviv Keller
9edf4a0856
test_runner: add support for coverage thresholds
Co-Authored-By: Marco Ippolito <marcoippolito54@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/54429
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2024-08-23 17:02:11 +00:00
Joyee Cheung
9ee3a720fe
src: remove cached data tag from snapshot metadata
This only served as a preemptive check, but serializing this in
the snapshot would make it unreproducible on different hardware.
In the current cached data version tag, the V8 version can already
be checked as part of the existing Node.js version check. The V8
flags aren't necessarily important for snapshot/code cache mismatches
(only a small subset are), and the CPU features currently don't
matter, so doing an exact match is stricter than necessary.
Removing the check to help making the snapshot more reproducible on
different hardware.

PR-URL: https://github.com/nodejs/node/pull/54122
Refs: https://github.com/nodejs/build/issues/3043
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2024-08-23 11:53:18 +00:00
Giovanni Bucci
628469c7e1
net: exclude ipv6 loopback addresses from server.listen
Fixes: https://github.com/nodejs/node/issues/51732
PR-URL: https://github.com/nodejs/node/pull/54264
Reviewed-By: Tim Perry <pimterry@gmail.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-08-23 09:11:43 +00:00
Marco Ippolito
e35902cddb
module: fix discrepancy between .ts and .js
PR-URL: https://github.com/nodejs/node/pull/54461
Fixes: https://github.com/nodejs/node/issues/54457
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com>
2024-08-22 08:48:33 +00:00
Michaël Zasso
612e4577ef
test: prevent V8 from writing into the system's tmpdir
Refs: https://github.com/nodejs/build/issues/3864
PR-URL: https://github.com/nodejs/node/pull/54395
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2024-08-21 15:44:39 +00:00
Antoine du Hamel
b4344cf006
test_runner: refactor mock_loader
PR-URL: https://github.com/nodejs/node/pull/54223
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
2024-08-21 15:44:29 +00:00
cjihrig
cc26951180 test_runner: support running tests in process
This commit introduces a new --experimental-test-isolation flag
that, when set to 'none', causes the test runner to execute all
tests in the same process. By default, this is the main test
runner process, but if watch mode is enabled, it spawns a separate
process that runs all of the tests.

The default value of the new flag is 'process', which uses the
existing behavior of running each test file in its own child
process.

It is worth noting that when the isolation mode is 'none', globals
and all other top level logic (such as top level before() and after()
hooks) is shared among all files.

Co-authored-by: Moshe Atlow <moshe@atlow.co.il>
PR-URL: https://github.com/nodejs/node/pull/53927
Fixes: https://github.com/nodejs/node/issues/51548
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2024-08-21 13:39:19 +00:00
Colin Ihrig
821ffab0f7
test_runner: account for newline in source maps
This commit updates the source mapping logic in the test runner
to account for newline characters that are not included in line
length calculations.

Co-authored-by: Simon Chan <1330321+yume-chan@users.noreply.github.com>
Fixes: https://github.com/nodejs/node/issues/54240
PR-URL: https://github.com/nodejs/node/pull/54444
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
2024-08-21 02:38:55 +00:00