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-03-02test: remove FLAKY status for test-http2-multistream-destroy-on-read-tlsRich Trott
The test does not seem to have failed since the issue was first reported in 2019. Closes: https://github.com/nodejs/node/issues/30845 PR-URL: https://github.com/nodejs/node/pull/37533 Fixes: https://github.com/nodejs/node/issues/30845 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-03-02test: make status file names consistentRich Trott
For some reason, the test/addons directory has a status file of addon.status rather than addons.status. Make it consistent with other directories. PR-URL: https://github.com/nodejs/node/pull/37532 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-03-02test: account for pending deprecations in esm testRich Trott
test-esm-local-deprecations fails if NODE_PENDING_DEPRECATION is set because the test expects exactly the warnings it expects and no other warnings. Modify the test to still expect its errors in the order it expects them, but to ignore errors it does not expect. PR-URL: https://github.com/nodejs/node/pull/37542 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-03-02workers: fix spawning from preload scriptsJames M Snell
Fix spawning nested worker threads from preload scripts and warn about doing so. Signed-off-by: James M Snell <jasnell@gmail.com> Fixes: https://github.com/nodejs/node/issues/36531 PR-URL: https://github.com/nodejs/node/pull/37481 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-02-28stream: move duplicated code to an internal moduleRich Trott
Create a utils module for isIterable(), isReadable(), and isStream(). PR-URL: https://github.com/nodejs/node/pull/37508 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-02-28worker: fix interaction of terminate() with messaging portAnna Henningsen
When a Worker is terminated, its own handle and the public `MessagePort` are `.ref()`’ed, so that all relevant events, including the `'exit'` events, end up being received. However, this is problematic if messages end up being queued from the Worker between the beginning of the `.terminate()` call and its completion, and there are no `'message'` event handlers present at that time. In that situation, currently the messages would not end up being processed, and since the MessagePort is still `.ref()`’ed, it would keep the event loop alive indefinitely. To fix this: - Make sure that all messages end up being received by `drainMessagePort()`, including cases in which the port had been stopped (i.e. there are no `'message'` listeners) and cases in which we exceed the limit for messages being processed in one batch. - Unref the Worker’s internal ports manually after the Worker has exited. Either of these solutions should be solving this on its own, but I think it makes sense to make sure that both of them happen during cleanup. PR-URL: https://github.com/nodejs/node/pull/37319 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-02-28child_process: fix spawn and fork abort behaviorNitzan Uziely
Fix AbortSignal in Spawn which doesn't actually abort the process, and fork can emit an AbortError even if the process was already exited. Add documentation For killSignal. Fixes: https://github.com/nodejs/node/issues/37273 PR-URL: https://github.com/nodejs/node/pull/37325 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-02-28stream: add AbortSignal support to finishedNitzan Uziely
PR-URL: https://github.com/nodejs/node/pull/37354 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-02-28crypto: check ed/x webcrypto key import algorithm namesFilip Skokan
PR-URL: https://github.com/nodejs/node/pull/37305 Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-28crypto: make FIPS related options always awailableVít Ondruch
There is no reason to hide FIPS functionality behind build flags. OpenSSL always provide the information about FIPS availability via `FIPS_mode()` function. This makes the user experience more consistent, because the OpenSSL library is always queried and the `crypto.getFips()` always returns OpenSSL settings. Fixes #34903 PR-URL: https://github.com/nodejs/node/pull/36341 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2021-02-28fs: fixup negative length in fs.truncateJames M Snell
`fs.ftruncate`, `fsPromises.truncate`, and `fsPromises.ftruncate` all adjust negative lengths to 0 before invoking the system call. `fs.truncate()` was the one outlier. This "fixes" https://github.com/nodejs/node/issues/35632 but in the opposite direction than discussed in the issue -- specifically by removing an EINVAL error from one function rather than adding it to another. Signed-off-by: James M Snell <jasnell@gmail.com> Fixes: https://github.com/nodejs/node/issues/35632 PR-URL: https://github.com/nodejs/node/pull/37483 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-02-28test: fix incorrect timers-promisified casettzztztz
PR-URL: https://github.com/nodejs/node/pull/37425 Fixes: https://github.com/nodejs/node/issues/37395 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
2021-02-28test: fix typo in test_node_crypto.ccIkko Ashimine
settting -> setting PR-URL: https://github.com/nodejs/node/pull/37469 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Pooja D P <Pooja.D.P@ibm.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-02-28test: remove FLAKY for test-http2-compat-client-upload-rejectRich Trott
As far as I know, this test hasn't failed since around the time it was first reported in 2019. Closes: https://github.com/nodejs/node/issues/30847 PR-URL: https://github.com/nodejs/node/pull/37462 Fixes: https://github.com/nodejs/node/issues/30847 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-28test: validate no debug info for http2Michael Dawson
Refs: https://github.com/nodejs/node/issues/31763 This test would have helped us catch the noisy output from http2 earlier. Currently none of the tests fail if there is unexpected debug output. Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: https://github.com/nodejs/node/pull/37447 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-02-28test: remove FLAKY designation for test-http2-client-upload-rejectRich Trott
The test hasn't failed in a long time as far as I can tell. The issue may have been fixed by various event updates/changes to http2 and related systems. PR-URL: https://github.com/nodejs/node/pull/37461 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-02-28test: clarify usage of tmpdir.refresh()Darshan Sen
This emphasizes that `tmpdir.refresh()` must be called only once in each test file when needed. PR-URL: https://github.com/nodejs/node/pull/37383 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2021-02-28test,child_process: add check for `subProcess.pid`dr-js
Note: this only add checks for async spawn, as the sync spawn do not return a `subProcess`. PR-URL: https://github.com/nodejs/node/pull/37014 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-02-28test: update upload.zip to be uncorruptedGreg Ziskind
PR-URL: https://github.com/nodejs/node/pull/37294 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2021-02-28test: fix flaky test-worker-profRich Trott
Fixes: https://github.com/nodejs/node/issues/26401 Co-authored-by: Gireesh Punathil <gpunathi@in.ibm.com> PR-URL: https://github.com/nodejs/node/pull/37372 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2021-02-28tools: make comma-dangle ESLint rule more stringent …Rich Trott
We've been having a lot of nits lately asking people to add trailing commas, so it's probably time to incrementally make the comma-dangle rule more stringent. PR-URL: https://github.com/nodejs/node/pull/37088 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-02-28bootstrap: include v8 module into the builtin snapshotJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/36943 Fixes: https://github.com/nodejs/node/issues/35930 Refs: https://github.com/nodejs/node/issues/35711 Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-28node-api: force env shutdown deferring behaviorGabriel Schulhof
The finalizer normally never gets called while a reference is strong. However, during environment shutdown all finalizers must get called. In order to unify the deferring behavior with that of a regular finalization, we must force the reference to be weak when we call its finalizer during environment shutdown. Fixes: https://github.com/nodejs/node/issues/37236 Co-authored-by: Chengzhong Wu <legendecas@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37303 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-02-28module: improve support of data: URLsAntoine du Hamel
Add support for loading modules using percent-encoded URLs. PR-URL: https://github.com/nodejs/node/pull/37392 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-02-28test: fix flaky test-webcrypto-encrypt-decrypt-aesDarshan Sen
* Use a copy of plaintext to prevent tampering of the original * Since subtle.decrypt returns a Promise containing an ArrayBuffer and ArrayBuffers cannot be modified directly, create a Buffer from it right away so that the modification in the next line works as intended Fixes: https://github.com/nodejs/node/issues/35586 PR-URL: https://github.com/nodejs/node/pull/37380 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
2021-02-28stream: add AbortSignal to promisified pipelineNitzan Uziely
add support for AbortSignal to promisified pipeline. Resolves: https://github.com/nodejs/node/issues/37321 PR-URL: https://github.com/nodejs/node/pull/37359 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com>
2021-02-28buffer: make Blob's constructor more spec-compliantMichaël Zasso
PR-URL: https://github.com/nodejs/node/pull/37361 Fixes: https://github.com/nodejs/node/issues/37352 Fixes: https://github.com/nodejs/node/issues/37356 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-28buffer: make Blob's slice method more spec-compliantMichaël Zasso
PR-URL: https://github.com/nodejs/node/pull/37361 Fixes: https://github.com/nodejs/node/issues/37335 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-28test: fix flaky test-fs-promises-file-handle-readRich Trott
tmpdir.refresh() cannot be called multiple times reliably on Raspberry Pi in CI because NFS might optimistically report a path as removed before it actually is. At least, that's what I think is going on. Anyway, tmpdir.refresh() is generally designed to be called once, so let's just call it once. PR-URL: https://github.com/nodejs/node/pull/37371 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-20http2: add unknownProtocol timeoutDaniel Bevenius
This commit add a configuration options named unknownProtocolTimeout which can be specified to set a value for the timeout in milliseconds that a server should wait when an unknowProtocol is sent to it. When this happens a timer will be started and the if the socket has not been destroyed during that time the timer callback will destoy it. Refs: https://hackerone.com/reports/1043360 CVE-ID: CVE-2021-22883 PR-URL: https://github.com/nodejs-private/node-private/pull/246 Reviewed-By: Beth Griggs <bgriggs@redhat.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-02-16test: fix test-doctool-htmlAntoine du Hamel
Refs: https://github.com/nodejs/node/pull/37301 PR-URL: https://github.com/nodejs/node/pull/37397 Reviewed-By: Danielle Adams <adamzdanielle@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-02-16tools: refactor prefer-primordialsAntoine du Hamel
Use optional chaining to improve code readability and remove use of `Array.prototype.reduce`. PR-URL: https://github.com/nodejs/node/pull/36018 Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
2021-02-16test: enable no-restricted-syntax rule for test-timers-promisifiedRich Trott
PR-URL: https://github.com/nodejs/node/pull/37357 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-02-16policy: fix cascade getting scopeBradley Farias
PR-URL: https://github.com/nodejs/node/pull/37298 Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Co-authored-by: James M Snell <jasnell@gmail.com>
2021-02-16fs: add fsPromises.watch()James M Snell
An alternative to `fs.watch()` that returns an `AsyncIterator` ```js const { watch } = require('fs/promises'); (async () => { const ac = new AbortController(); const { signal } = ac; setTimeout(() => ac.abort(), 10000); const watcher = watch('file.txt', { signal }); for await (const { eventType, filename } of watcher) { console.log(eventType, filename); } })() ``` Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37179 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-02-16buffer: add @@toStringTag to Blobcjihrig
This commit adds the toStringTag to the Blob class to match the behavior of Chrome and Firefox. PR-URL: https://github.com/nodejs/node/pull/37336 Fixes: https://github.com/nodejs/node/issues/37337 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2021-02-16perf_hooks: introduce createHistogramJames M Snell
Adds a new `perf_hooks.createHistogram()` API for creating histogram instances that allow user recording. Makes Histogram instances cloneable via MessagePort. This allows, for instance, an event loop delay monitor to be running on the main thread while the histogram data can be monitored actively from a worker thread. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37155 Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-02-16url: fix definitions of `URL`/`SearchParams` methods and accessorsExE Boss
This fixes getter and setter names for the WHATWG URL classes, and fixes a few other inconsistencies with browsers implementations. Co-authored-by: Gerhard Stöbich <deb2001-github@yahoo.de> PR-URL: https://github.com/nodejs/node/pull/36799 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2021-02-16async_hooks: set unhandledRejection async contextSajal Khandelwal
This commit now executes `process.on('unhandledRejection')` in the async execution context of the concerned `Promise`. PR-URL: https://github.com/nodejs/node/pull/37281 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-02-16test: re-implement promises.setInterval() test robustlyRich Trott
Fixes: https://github.com/nodejs/node/issues/37226 PR-URL: https://github.com/nodejs/node/pull/37230 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-02-16errors: align source-map stacks with specbcoe
Reformat stack traces when --enable-source-maps flag is set to format more likely to fit https://github.com/tc39/proposal-error-stacks PR-URL: https://github.com/nodejs/node/pull/37252 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ian Sutherland <ian@iansutherland.ca> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2021-02-16node-api: allow retrieval of add-on file nameGabriel Schulhof
Unlike JS-only modules, native add-ons are always associated with a dynamic shared object from which they are loaded. Being able to retrieve its absolute path is important to native-only add-ons, i.e. add-ons that are not themselves being loaded from a JS-only module located in the same package as the native add-on itself. Currently, the file name is obtained at environment construction time from the JS `module.filename`. Nevertheless, the presence of `module` is not required, because the file name could also be passed in via a private property added onto `exports` from the `process.dlopen` binding. As an attempt at future-proofing, the file name is provided as a URL, i.e. prefixed with the `file://` protocol. Fixes: https://github.com/nodejs/node-addon-api/issues/449 PR-URL: https://github.com/nodejs/node/pull/37195 Co-authored-by: Michael Dawson <mdawson@devrus.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-02-16crypto: fix subtle.importKey JWK OKP public key importFilip Skokan
PR-URL: https://github.com/nodejs/node/pull/37255 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-02-16lib: fix WebIDL `object` and dictionary type conversionExE Boss
PR-URL: https://github.com/nodejs/node/pull/37047 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-02-16test: only run prime test with supported OpenSSLTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/37212 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-02-16crypto: avoid infinite loops in prime generationTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/37212 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-02-16lib: add weak event handlersBenjamin Gruenbaum
PR-URL: https://github.com/nodejs/node/pull/36607 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
2021-02-16crypto: fix and simplify prime option validationTobias Nießen
PR-URL: https://github.com/nodejs/node/pull/37164 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-02-16repl: add auto‑completion for dynamic import callsExE Boss
Refs: https://github.com/nodejs/node/issues/33238 Refs: https://github.com/nodejs/node/pull/33282 Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37178 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-02-16fs: allow passing negative zero fdDarshan Sen
Fixes: https://github.com/nodejs/node/issues/37122 PR-URL: https://github.com/nodejs/node/pull/37123 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>