Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-06-22errors: don't rekey on primitive typebcoe
If an error is thrown before a module is loaded, we attempt to cache source map against error object, rather than module object. We can't do this if the error is a primitive type Fixes #38945 PR-URL: https://github.com/nodejs/node/pull/39025 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-06-22async_hooks: check for empty contexts before removingBryan English
This way we don't end up attempting to SetPromiseHooks on contexts that have already been collected. Fixes: https://github.com/nodejs/node/issues/39019 PR-URL: https://github.com/nodejs/node/pull/39095 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com> Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
2021-06-22src: allow to negate boolean CLI flagsMichaël Zasso
This change allows all boolean flags to be negated using the `--no-` prefix. Flags that are `true` by default (for example `--deprecation`) are still documented as negations. With this change, it becomes possible to easily flip the default value of a boolean flag and to override the value of a flag passed in the NODE_OPTIONS environment variable. `process.allowedNodeEnvironmentFlags` contains both the negated and non-negated versions of boolean flags. Co-authored-by: Anna Henningsen <anna@addaleax.net> PR-URL: https://github.com/nodejs/node/pull/39023 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2021-06-21test: move inspector-cli tests to sequentialRich Trott
There's no reason to keep these tests separated from everything else. PR-URL: https://github.com/nodejs/node/pull/39079 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-06-21test: improve buffer coverageRongjian Zhang
PR-URL: https://github.com/nodejs/node/pull/38538 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-06-21test: fix name of variable in inspector-cli testTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/38869 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-06-21test: fix typoHoussem Chebab
PR-URL: https://github.com/nodejs/node/pull/39045 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-06-21crypto: fix aes crash when tag length too smallXadillaX
Fixes: https://github.com/nodejs/node/issues/38883 PR-URL: https://github.com/nodejs/node/pull/38914 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-06-15test: fix typo in test-http2-invalidheaderfield.jsIkko Ashimine
Psuedo -> Pseudo PR-URL: https://github.com/nodejs/node/pull/39021 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-06-15tools: update doctool dependencies, migrate to ESMMichaël Zasso
- Migrated to ESM because some dependencies now require it. - Did not update `highlight.js` to v11 because it has many breaking changes. - Used non-deprecated `highlight.js` API. Refs: https://github.com/highlightjs/highlight.js/issues/2277 Fixes: https://github.com/nodejs/node/issues/38938 Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: https://github.com/nodejs/node/pull/38966 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-06-15stream: fix pipeline pumpRobert Nagy
Refs: https://github.com/nodejs/node/issues/39005 PR-URL: https://github.com/nodejs/node/pull/39006 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-06-15report: generates report on threads with no isolateslegendecas
PR-URL: https://github.com/nodejs/node/pull/38994 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-06-14src: fix multiple AddLinkedBinding() callsAnna Henningsen
Singly-linked lists are extended at their tail, not their head. This fixes using more than 2 linked addons at a time. PR-URL: https://github.com/nodejs/node/pull/39012 Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
2021-06-14lib: make primordials Promise methods safeAntoine du Hamel
`catch` and `finally` methods on %Promise.prototype% looks up the `then` property of the instance, making it at risk of prototype pollution. PR-URL: https://github.com/nodejs/node/pull/38650 Backport-PR-URL: https://github.com/nodejs/node/pull/38878 Refs: https://tc39.es/ecma262/#sec-promise.prototype.catch Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-06-14test: adapt abort tests for new Windows codeMichaël Zasso
V8 9.1 changed the way it aborts on uncaught exceptions on Windows. It now uses the code 0x80000003 (exception breakpoint) instead of 0xC0000005 (access violation). Refs: https://github.com/v8/v8/commit/26d85acee2c052aa128b77e2e5fde1d4c9306910 PR-URL: https://github.com/nodejs/node/pull/38273 Backport-PR-URL: https://github.com/nodejs/node/pull/38991 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Mary Marchini <oss@mmarchini.me>
2021-06-14test: adapt test-linux-perf to V8 changesMichaël Zasso
Refs: https://github.com/v8/v8/commit/9a31804bbe6597bfb54b47958fd3839f2da51875 PR-URL: https://github.com/nodejs/node/pull/38273 Backport-PR-URL: https://github.com/nodejs/node/pull/38991 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Mary Marchini <oss@mmarchini.me>
2021-06-14test: fix V8 serdes test for V8 9.1Michaël Zasso
Refs: https://github.com/v8/v8/commit/40e499cd28b2f21652f4b05a35a146c498e86a39 PR-URL: https://github.com/nodejs/node/pull/38273 Backport-PR-URL: https://github.com/nodejs/node/pull/38991 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Mary Marchini <oss@mmarchini.me>
2021-06-14module: fix legacy `node` specifier resolution to resolve `"main"` fieldAntoine du Hamel
PR-URL: https://github.com/nodejs/node/pull/38979 Fixes: https://github.com/nodejs/node/issues/32103 Fixes: https://github.com/nodejs/node/issues/38739 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>
2021-06-14test: remove obsolete TLS testRich Trott
The test involving melissadata.net was to make sure Node.js still tolerated ValiCert 1024-bit certs. It has been several years since melissadata.net used ValiCert as a root certificate and for that matter, we removed ValiCert in a4dbf45b5958d7be95d5aec8de934526c36a7b12 so it would have broken then if it was still using it. The test is no longer valid or needed and hasn't been for several years. PR-URL: https://github.com/nodejs/node/pull/39001 Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-06-13node-api: avoid crashing on passed-in null stringGabriel Schulhof
When `napi_create_string_*` receives a null pointer as its second argument, it must null-check it before passing it into V8, otherwise a crash will occur. Signed-off-by: Gabriel Schulhof <gabrielschulhof@gmail.com> PR-URL: https://github.com/nodejs/node/pull/38923 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-06-11test: improve coverage of lib/events.jsRongjian Zhang
PR-URL: https://github.com/nodejs/node/pull/38582 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-06-11test: http outgoing _headers setter nullycjcl868
Co-authored-by: Qingyu Deng <i@ayase-lab.com> PR-URL: https://github.com/nodejs/node/pull/38881 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-06-11test: suppress warning in test_environment.ccDaniel Bevenius
Currently there is a compiler warning generated if a build defines NDEBUG: $ env CXXFLAGS='-DNDEBUG' make -j8 cctest ../test/cctest/test_environment.cc: In function ‘void at_exit_js(void*)’: ../test/cctest/test_environment.cc:333:25: warning: variable ‘obj’ set but not used [-Wunused-but-set-variable] 333 | v8::Local<v8::Object> obj = v8::Object::New(isolate); | ^~~ NDEBUG is currently not defined using the main branch but this discovered when working on replacing OpenSSL 1.1.1 with OpenSSL 3.0. This commit uses EXPECT statements instead of asserts to avoid the warning. PR-URL: https://github.com/nodejs/node/pull/38868 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-06-11Revert "http: make HEAD method to work with keep-alive"Michaël Zasso
This reverts commit 7afa5336aed999a62e4943e6000a239585b2e2ea. The change breaks clients like cURL. Fixes: https://github.com/nodejs/node/issues/38922 PR-URL: https://github.com/nodejs/node/pull/38949 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Mary Marchini <oss@mmarchini.me> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2021-06-11src,test: raise error for --enable-fips when no FIPSDaniel Bevenius
This commit moves the check for FIPS from the crypto module initialization to process startup. The motivation for this is that when OpenSSL is not FIPS enabled and the command line options --enable-fips, or --force-fips are used, there will only be an error raised if the crypto module is used. This can be surprising and we have gotten feedback that users assumed that there would be an error if these options were specified and FIPS is not available. PR-URL: https://github.com/nodejs/node/pull/38859 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <rlau@redhat.com>
2021-06-11src: skip test_fatal/test_threads for Debug buildsDaniel Bevenius
Currently test/node-api/test_fatal/test_threads.js fails for a Debug build with the following error: 1: 0x101e3f8 node::DumpBacktrace(_IO_FILE*) [/node/out/Debug/node] 2: 0x11c31ed [/node/out/Debug/node] 3: 0x11c320d [/node/out/Debug/node] 4: 0x2ba4448 V8_Fatal(char const*, int, char const*, ...) [/node/out/Debug/node] 5: 0x2ba4473 [/node/out/Debug/node] 6: 0x139e049 v8::internal::Isolate::Current() [/node/out/Debug/node] 7: 0x11025ee node::OnFatalError(char const*, char const*) [/node/out/Debug/node] 8: 0x1102564 node::FatalError(char const*, char const*) [/node/out/Debug/node] 9: 0x10add1d napi_open_callback_scope [/node/out/Debug/node] 10: 0x7f05664211dc [/node/test/node-api/test_fatal/build/Debug/test_fatal.node] 11: 0x7f056608e4e2 [/usr/lib64/libpthread.so.0] 12: 0x7f0565fbd6c3 clone [/usr/lib64/libc.so.6] node:assert:412 throw err; ^ AssertionError [ERR_ASSERTION]: The expression evaluated to a falsy value: assert.ok(p.status === 134 || p.signal === 'SIGABRT') at Object.<anonymous> (/node/test/node-api/test_fatal/test_threads.js:21:8) at Module._compile (node:internal/modules/cjs/loader:1109:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10) at Module.load (node:internal/modules/cjs/loader:989:32) at Function.Module._load (node:internal/modules/cjs/loader:829:14) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12) at node:internal/main/run_main_module:17:47 { generatedMessage: true, code: 'ERR_ASSERTION', actual: false, expected: true, operator: '==' } This is caused by a call to Isolate::GetCurrent() when the calling thread has not initialized V8. We are working suggestion to add a method to V8 which allows a check/get without any checks but in the mean time this change should allow debug builds to pass the test suit. PR-URL: https://github.com/nodejs/node/pull/38805 Refs: https://chromium-review.googlesource.com/c/v8/v8/+/2910630 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-06-11async_hooks: switch between native and context hooks correctlyStephen Belanger
:facepalm: Might help if I remember to disable the _other_ promise hook implementation when switching between them... Fixes #38814 Fixes #38815 Refs #36394 PR-URL: https://github.com/nodejs/node/pull/38912 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Bryan English <bryan@bryanenglish.com>
2021-06-11node-api: rtn pending excep on napi_new_instancelegendecas
When there are any JavaScript exceptions pending, `napi_pending_exception` should be returned. PR-URL: https://github.com/nodejs/node/pull/38798 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-06-11child_process: allow `options.cwd` receive a URLXadillaX
PR-URL: https://github.com/nodejs/node/pull/38862 Fixes: https://github.com/nodejs/node/issues/38861 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-06-11dns: allow `--dns-result-order` to change default dns verbatimOuyang Yadong
Allow the `--dns-result-order` option to change the default value of verbatim in `dns.lookup()`. This is useful when running Node.js in ipv6-only environments to avoid possible ENETUNREACH errors. PR-URL: https://github.com/nodejs/node/pull/38099 Refs: https://github.com/nodejs/node/issues/31566 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-06-02src: set PromiseHooks by EnvironmentBryan English
The new JS PromiseHooks introduced in the referenced PR are per v8::Context. This meant that code depending on them, such as AsyncLocalStorage, wouldn't behave correctly across vm.Context instances. PromiseHooks are now synchronized across the main Context and any Context created via vm.Context. Refs: https://github.com/nodejs/node/pull/36394 Fixes: https://github.com/nodejs/node/issues/38781 Signed-off-by: Bryan English <bryan@bryanenglish.com> PR-URL: https://github.com/nodejs/node/pull/38821 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2021-06-02test: improve coverage of fs internal utilsRongjian Zhang
Refs: https://coverage.nodejs.org/coverage-910efc2d9a69ac32/lib/internal/fs/utils.js.html#L634 PR-URL: https://github.com/nodejs/node/pull/38746 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-06-02lib: include url in bootstrap snapshot and remove unnecessary lazy-loadsJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/38826 Refs: https://github.com/nodejs/node/issues/35711 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Khaidi Chu <i@2333.moe>
2021-06-02test: remove unnecessary `--pending-deprecation` flagAntoine du Hamel
PR-URL: https://github.com/nodejs/node/pull/38819 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-06-02os: add os.devNullLuigi Pinca
Provides the platform-specific file path of the null device. PR-URL: https://github.com/nodejs/node/pull/38569 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-05-31test: fix writefile with fdNitzan Uziely
fix writefile with fd so that it'll close the fds that is uses during the test. PR-URL: https://github.com/nodejs/node/pull/38820 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-05-31test: simplify test-path-resolve.jshimself65
PR-URL: https://github.com/nodejs/node/pull/38671 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-05-31lib: remove unnecessary lazy loadsJoyee Cheung
Now that more modules are included in the snapshot, it's not necessary to lazy load them anymore PR-URL: https://github.com/nodejs/node/pull/38737 Refs: https://github.com/nodejs/node/issues/35711 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-05-31lib: load internal/fs/watchers and internal/fs/read_file_context earlyJoyee Cheung
So that they are included in the builtin snapshot PR-URL: https://github.com/nodejs/node/pull/38737 Refs: https://github.com/nodejs/node/issues/35711 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-05-31test: improve coverage for `question` in readlineQingyu Deng
PR-URL: https://github.com/nodejs/node/pull/38799 Refs: https://coverage.nodejs.org/coverage-dc43066ee9a37655/lib/readline.js.html#L443 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-05-31test: os, replace custom flatten method with built-in Array.flatWael Almattar
PR-URL: https://github.com/nodejs/node/pull/38770 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-05-31stream: add a non-destroying iterator to ReadableNitzan Uziely
add a non-destroying iterator to Readable fixes: https://github.com/nodejs/node/issues/38491 PR-URL: https://github.com/nodejs/node/pull/38526 Fixes: https://github.com/nodejs/node/issues/38491 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-05-31cli: add -C alias for --conditions flagGuy Bedford
PR-URL: https://github.com/nodejs/node/pull/38755 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com>
2021-05-31test: set locale for datetime-change-notify testZiJian Liu
The time zone output by toString() will change with user's language, use toLocaleString() to set the time zone. PR-URL: https://github.com/nodejs/node/pull/38741 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
2021-05-31src: set CONF_MFLAGS_DEFAULT_SECTION for OpenSSL 3Daniel Bevenius
This commit adds a call to OPENSSL_init_crypto to initialize OPENSSL_INIT_LOAD_CONFIG to avoid the default behavior where errors raised during the parsing of the OpenSSL configuration file are not propagated and cannot be detected. The motivation for this is that if FIPS is configured the OpenSSL configuration file will have an .include pointing to the fipsmodule.cnf file generated by the openssl fipsinstall command. If the path to this file is incorrect no error will be reported. For Node.js this will mean that EntropySource will be called by V8 as part of its initalization process, and EntropySource will in turn call CheckEntropy. CheckEntropy will call RAND_status which will now always return 0 leading to an endless loop and the node process will appear to hang/freeze. I'll continue investigating the cause of this and see if this is expected behavior or not, but in the mean time it would be good to be able to workaround this issue with this commit. PR-URL: https://github.com/nodejs/node/pull/38732 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com> Refs: https://github.com/nodejs/node/pull/38633#pullrequestreview-658811317
2021-05-31child_process: retain reference to data with advanced serializationAnna Henningsen
Do the same thing we do for other streams, and retain a reference to the Buffer that was sent over IPC while the write request is active, so that it doesn’t get garbage collected while the data is still in flight. (This is a good example of why it’s a bad idea that we’re not re-using the general streams implementation for IPC and instead maintain separate usage of the low-level I/O primitives.) Fixes: https://github.com/nodejs/node/issues/34797 PR-URL: https://github.com/nodejs/node/pull/38728 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
2021-05-31url: exit early when : delimiter is seen in hostnameTimothy Gu
This aligns with an upstream spec change. PR-URL: https://github.com/nodejs/node/pull/38742 Fixes: https://github.com/nodejs/node/issues/38710 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-05-31test: improve coverage of lib/fs.jsRongjian Zhang
PR-URL: https://github.com/nodejs/node/pull/38604 Refs: https://coverage.nodejs.org/coverage-29f1b609ba5d12d3/lib/fs.js.html#L2045 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-05-31test: improve coverage of lib/_http_outgoing.jsRongjian Zhang
Refs: https://coverage.nodejs.org/coverage-36bb31be5f0b85a0/lib/_http_outgoing.js.html#L351 Refs: https://coverage.nodejs.org/coverage-36bb31be5f0b85a0/lib/_http_outgoing.js.html#L609 PR-URL: https://github.com/nodejs/node/pull/38734 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-05-31src: use HandleScope in StreamReq::Done()Darshan Sen
Fixes: https://github.com/nodejs/node/issues/38707 PR-URL: https://github.com/nodejs/node/pull/38720 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>