6946 Commits
Author SHA1 Message Date
Richard Lau 7acea78493 test: mark flaky tests on IBM i
PR-URL: https://github.com/nodejs/node/pull/36986
Refs: https://github.com/nodejs/node/issues/34410
Refs: https://github.com/nodejs/node/issues/36925
Refs: https://github.com/nodejs/node/issues/36929
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-01-24 21:43:36 -05:00
Ian Storm Taylor 70ee7dce62 http: attach request as res.req
This change makes it possible for userland http-related modules
to pave over edge cases that require referencing the original request
when handling a response--making a "Lodash for HTTP" library possible.
More information and research in https://github.com/nodejs/node/issues/28673

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

PR-URL: https://github.com/nodejs/node/pull/36505
Reviewed-By: Robert Nagy <ronagy@icloud.com>
2021-01-24 21:43:36 -05:00
James M Snell 775b34b822 buffer: introduce Blob
The `Blob` object is an immutable data buffer. This is a first step
towards alignment with the `Blob` Web API.

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

PR-URL: https://github.com/nodejs/node/pull/36811
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-01-24 21:43:34 -05:00
raisinten fada6b0087 test,benchmark: stop requiring URL and URLSearchParams
Since the URL and URLSearchParams classes are available in the
global object, there is no need to require them from 'url'.

PR-URL: https://github.com/nodejs/node/pull/36927
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-01-24 21:43:34 -05:00
Emil Sivervik 2f1f1dadaa test: increase buffer list coverage
1. test consuming BufferList which has strings with > 1 items
Refs: https://coverage.nodejs.org/coverage-0b6d3070a176d437/lib/internal/streams/buffer_list.js.html#L116

2. test consuming BufferList with > 1 items
Refs: https://coverage.nodejs.org/coverage-0b6d3070a176d437/lib/internal/streams/buffer_list.js.html#L152

PR-URL: https://github.com/nodejs/node/pull/36688
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-24 21:43:33 -05:00
Daniel Bevenius 98369aaf7b test: remove unused ecdhPeerKey
This commit removed ecdhPeerKey from test-webcrypto-wrap-unwrap.js which
seems to be unsued.

PR-URL: https://github.com/nodejs/node/pull/36942
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-01-24 21:43:33 -05:00
raisinten 9951daefbd repl: refactor to avoid unsafe array iteration
PR-URL: https://github.com/nodejs/node/pull/36663
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-24 21:43:32 -05:00
ZiJian Liu dc596d0607 events: remove error listener on signal abort
Fixes: https://github.com/nodejs/node/issues/36949

PR-URL: https://github.com/nodejs/node/pull/36969
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-01-24 21:43:31 -05:00
Filip Skokan 832cd015d5 buffer: add base64url encoding option
PR-URL: https://github.com/nodejs/node/pull/36952
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-01-21 17:57:33 -05:00
Juan José Arboleda ba87be0b0e test: improve coverage for Module getters
PR-URL: https://github.com/nodejs/node/pull/36950
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-01-21 17:57:33 -05:00
Ruy Adorno c7dd9c8c69 test: skip internet for test-npm-install
Disabling any internet-required features (namely audit and
update-notifer) in order for the test to work without an internet
connection.

- Fixes: https://github.com/nodejs/node/issues/36895

PR-URL: https://github.com/nodejs/node/pull/36933
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-01-21 17:57:33 -05:00
Juan José Arboleda 3bbe9a5588 test: improve coverage on worker threads
PR-URL: https://github.com/nodejs/node/pull/36910
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-01-21 17:48:12 -05:00
ZiJian Liu 889654d36c url: align url format behavior with browsers
Fixes: https://github.com/nodejs/node/issues/36887

PR-URL: https://github.com/nodejs/node/pull/36903
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2021-01-21 17:48:11 -05:00
Juan José Arboleda f589bb2052 test: improve coverage at lib/internal/vm/module.js
PR-URL: https://github.com/nodejs/node/pull/36898
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-01-21 17:48:11 -05:00
Rod Vagg 8a8241529e Revert "test: mark test-cluster-bind-privileged-port flaky on arm"
This reverts commit a45a404197.

Solved by marking ports <1024 as privileged on Docker containers.

Ref: https://github.com/nodejs/node/pull/36850
Ref: https://github.com/nodejs/node/issues/36847
Ref: https://github.com/nodejs/build/pull/2521

PR-URL: https://github.com/nodejs/node/pull/36884
Refs: https://github.com/nodejs/node/pull/36850
Refs: https://github.com/nodejs/node/issues/36847
Refs: https://github.com/nodejs/build/pull/2521
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ash Cripps <acripps@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-01-21 17:48:11 -05:00
zhangyongsheng 64fed319ef url: expose urlToHttpOptions utility
PR-URL: https://github.com/nodejs/node/pull/35960
Fixes: https://github.com/nodejs/node/issues/34349
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2021-01-21 17:48:10 -05:00
James M Snell 99c15909ad test: fixup flaky test-crypto-x509 on windows
PR-URL: https://github.com/nodejs/node/pull/36966
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-01-21 17:48:09 -05:00
Tobias Nießen c2ec15aff6 test: check mustCall errors in test-fs-read-type
PR-URL: https://github.com/nodejs/node/pull/36914
Refs: https://github.com/nodejs/node/pull/36190
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-01-21 17:48:06 -05:00
Tobias Nießen 30b2aac98a test: fix variable name for non-RSA keys
PR-URL: https://github.com/nodejs/node/pull/36912
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2021-01-21 17:48:06 -05:00
Mateusz Krawczuk 864b97b24d tls: use recently added matching SecureContext in default SNICallback
PR-URL: https://github.com/nodejs/node/pull/36072
Fixes: https://github.com/nodejs/node/issues/34110
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-01-21 17:48:05 -05:00
Filip Skokan 1149af6265 crypto: add keyObject.asymmetricKeyDetails for asymmetric keys
This API exposes key details. It is conceptually different from the
previously discussed keyObject.fields property since it does not give
access to information that could compromise the security of the key, and
the obtained information cannot be used to uniquely identify a key.

The intended purpose is to determine "security properties" of keys, e.g.
to generate a new key pair with the same parameters, or to decide
whether a key is secure enough.

closes #30045

PR-URL: https://github.com/nodejs/node/pull/36188
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-01-21 17:48:04 -05:00
Tobias Nießen 0398167b35 crypto: fix WebCrypto import of RSA-PSS keys
This patch changes GetRsaKeyDetail to work in older supported versions
of OpenSSL.

Refs: https://github.com/openssl/openssl/pull/10217

PR-URL: https://github.com/nodejs/node/pull/36877
Refs: https://github.com/nodejs/node/pull/36188
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2021-01-21 17:48:02 -05:00
raisinten c4cdf1d830 fs: allow position parameter to be a BigInt in read and readSync
Fixes: https://github.com/nodejs/node/issues/36185

PR-URL: https://github.com/nodejs/node/pull/36190
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-01-21 17:48:02 -05:00
James M Snell abc2ff47c2 test: disable test-crypto-secure-heap with asan
The asan checks don't play well currently with persistent secure
heap allocations.

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

PR-URL: https://github.com/nodejs/node/pull/36900
Refs: https://github.com/nodejs/node/pull/36881
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2021-01-12 17:55:55 -05:00
Dimitris Halatsis 17a52337c4 test: http complete response after socket double end
PR-URL: https://github.com/nodejs/node/pull/36633
Fixes: https://github.com/nodejs/node/issues/36620
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
2021-01-12 07:11:45 -05:00
Robert Nagy a9a2dd32e3 http: don't cork noop .end()
Calling .end() a second time should be a noop and not
leave the socket corked.

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

PR-URL: https://github.com/nodejs/node/pull/36633
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
2021-01-12 07:11:45 -05:00
Robert Nagy abae61e230 stream: finished waits for 'close' on OutgoingMessage
Don't invoke finished callback until OutgoingMessagehas
emitted 'close'.

PR-URL: https://github.com/nodejs/node/pull/36648
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-12 07:11:44 -05:00
Pooja D P cc37ff24dc test: use faster variant for rss in test-crypto-dh-leak
PR-URL: https://github.com/nodejs/node/pull/36766
Refs: https://github.com/nodejs/node/pull/34291
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-12 07:11:43 -05:00
James M Snell 53cf996270 crypto: implement basic secure heap support
Adds two new command line arguments:

* `--secure-heap=n`, which causes node.js to initialize
  an openssl secure heap of `n` bytes on openssl initialization.
* `--secure-heap-min=n`, which specifies the minimum allocation
  from the secure heap.
* A new method `crypto.secureHeapUsed()` that returns details
  about the total and used secure heap allocation.

The secure heap is an openssl feature that allows certain kinds
of potentially sensitive information (such as private key
BigNums) to be allocated from a dedicated memory area that is
protected against pointer over- and underruns.

The secure heap is a fixed size, so it's important that users
pick a large enough size to cover the crypto operations they
intend to utilize.

The secure heap is disabled by default.

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

PR-URL: https://github.com/nodejs/node/pull/36779
Refs: https://github.com/nodejs/node/pull/36729
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-01-12 07:11:43 -05:00
Robert Nagy 4c819d65f9 stream: fix .end() error propagation
PR-URL: https://github.com/nodejs/node/pull/36817
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-01-12 07:11:42 -05:00
Ouyang Yadong 54bd4ab855 cluster: fix edge cases that throw ERR_INTERNAL_ASSERTION
Some cases use both `cluster` and `net`/`cluser` will throw
ERR_INTERNAL_ASSERTION when `listen`/`bind` to the port of `0`. This
PR maitains a separate map of the index to fix the issue. See the new
tests added for the detail cases.

PR-URL: https://github.com/nodejs/node/pull/36764
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-01-12 07:11:36 -05:00
Momtchil Momtchev cb0b53edb1 stream: lazy read ReadStream
Using stream._construct would cause the Readable
to incorrectly greedily start reading.

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

PR-URL: https://github.com/nodejs/node/pull/36823
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2021-01-12 07:10:56 -05:00
ZiJian Liu 24246a29d7 net: throw ERR_OUT_OF_RANGE if blockList.addSubnet prefix is NaN
Fixes: https://github.com/nodejs/node/issues/36731

PR-URL: https://github.com/nodejs/node/pull/36732
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-12 07:10:53 -05:00
James M Snell c4ad50e0ff crypto: introduce X509Certificate API
Introduces the `crypto.X509Certificate` object.

```js
const { X509Certificate } = require('crypto');

const x509 = new X509Certificate('{pem encoded cert}');
console.log(x509.subject);
```

Fixes: https://github.com/nodejs/node/issues/29181
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/36804
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2021-01-12 07:10:52 -05:00
Antoine du Hamel 9b9b6d5fc5 domain: make node resilient to Array prototype tempering
Fixes: https://github.com/nodejs/node/issues/36669

PR-URL: https://github.com/nodejs/node/pull/36676
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-12 07:10:52 -05:00
James M Snell 94afc3e712 process: passing -1 to setuid/setgid should not abort
Fixes: https://github.com/nodejs/node/issues/32750
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/36786
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2021-01-12 07:10:51 -05:00
James M Snell 9d25d25cfd test: mark test-cluster-bind-privileged-port flaky on arm
Per rvagg:
```
Persistent failure, even after restarts of the whole cluster. #36478 was
merged into this test yesterday but the parent commit still has the
failures.

What has changed is the Docker version. They all got an upgrade to
5:20.10.2~3-0~raspbian-buster and this is all running inside containers.
It's going to be the newest version of Docker running in our CI and I
wonder whether we're going to see similar failures when we upgrade other
hosts or if this is going to be restricted to ARM.

Other than that, I'm not sure what this could be. It seems like a
straightforward test that shouldn't fail, maybe Docker has introduced
something new for unprivileged port binding inside containers?
```

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

PR-URL: https://github.com/nodejs/node/pull/36850
Refs: https://github.com/nodejs/node/issues/36847
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
2021-01-12 07:10:50 -05:00
Pooja D P c64db20fdd test: use faster variant for rss test-memoryusage-emfile
PR-URL: https://github.com/nodejs/node/pull/36768
Refs: https://github.com/nodejs/node/pull/34291
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-01-12 07:10:50 -05:00
James M Snell 4e4deca90d crypto: implement randomuuid
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/36729
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
2021-01-12 07:10:48 -05:00
Antoine du Hamel b17130a55a readline: fix behaviour of Interface plugged to a non-terminal output
Fixes: https://github.com/nodejs/node/issues/36773

PR-URL: https://github.com/nodejs/node/pull/36774
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2021-01-12 07:10:46 -05:00
Daniele Belardi dfc962f67a http: add test case for req-res close ordering
Since 55e83cbe95
has changed the ordering of the close event, add a test case.
IncomingMessage will emit close before the response is sent in case the
server is consuming data from it.

Refs: https://github.com/nodejs/node/pull/33035#issuecomment-751489998

PR-URL: https://github.com/nodejs/node/pull/36645
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-01-12 07:10:43 -05:00
Matteo Collina cc28d2f541 http: set lifo as the default scheduling strategy in Agent
PR-URL: https://github.com/nodejs/node/pull/36685
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-01-12 07:10:42 -05:00
Matteo Collina b996e3b4b5 stream: do not use _stream_* anymore
Remove all leftover usage of _stream_* and keep all of them as legacy.
We do not deprecate the old modules to avoid disrupition and ease
maintainance.

PR-URL: https://github.com/nodejs/node/pull/36684
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-01-12 07:10:39 -05:00
Rich Trott d48e00e5a3 test: fix test-memory-usage.js for IBMi
Newly added process.memoryUsage.rss() will presumably return 0 on IBMi
the same way process.memoryUsage().rss does. Allow IBMi to skip the new
assertion.

The test was using a mix of `assert()` and `assert.ok()`. This change
makes it consistently use `assert.ok()`.

PR-URL: https://github.com/nodejs/node/pull/36758
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-01-12 07:10:38 -05:00
Michaël Zasso 9b7d2c2523 test: guard large string decoder allocation
Use common.enoughTestMem to avoid "Array buffer allocation failed"
error on low memory devices.

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

PR-URL: https://github.com/nodejs/node/pull/36795
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Pooja D P <Pooja.D.P@ibm.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2021-01-12 07:10:37 -05:00
ZiJian Liu 5bc130bd9e test: increase coverage for events
1. test EventEmitter.setMaxListeners with invalid listener count
https://coverage.nodejs.org/coverage-0b6d3070a176d437/lib/events.js.html#L171

2. test EventEmitter.setMaxListeners with invalid emitter
https://coverage.nodejs.org/coverage-0b6d3070a176d437/lib/events.js.html#L186

3. test getEventListeners with invalid emiiter
Refs: https://coverage.nodejs.org/coverage-0b6d3070a176d437/lib/events.js.html#L706

4. test events.once with options: null
Refs: https://coverage.nodejs.org/coverage-0b6d3070a176d437/lib/events.js.html#L712

5. add test case for inspect new Event()
Refs: https://coverage.nodejs.org/coverage-0b6d3070a176d437/lib/internal/event_target.js.html#L111

6. add test case for insepct new EventTarget()
Refs: https://coverage.nodejs.org/coverage-0b6d3070a176d437/lib/internal/event_target.js.html#L446

7. add test case for Event and EventTarget constructor name

PR-URL: https://github.com/nodejs/node/pull/36668
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2021-01-12 07:10:34 -05:00
Rich Trott 9f7fbcc64d test: add coverage for breakLength one-column array
Add coverage for breakLength option resulting in a single-column array
display.

Refs: https://coverage.nodejs.org/coverage-0b6d3070a176d437/lib/internal/util/inspect.js.html#L1277

PR-URL: https://github.com/nodejs/node/pull/36657
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-12 07:10:32 -05:00
Joseph Hackman 954a36947d http: make HEAD method to work with keep-alive
Fixes: https://github.com/nodejs/node/issues/28438

PR-URL: https://github.com/nodejs/node/pull/34231
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-12 07:10:32 -05:00
Thiago Padilha 9bc2cec848 child_process: add 'overlapped' stdio flag
The 'overlapped' value sets the UV_OVERLAPPED_PIPE libuv flag in the
child process stdio.

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

PR-URL: https://github.com/nodejs/node/pull/29412
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-12 07:10:31 -05:00
Adrien Maret 92af50327e process: add direct access to rss without iterating pages
Accessing the rss value through memoryUsage() can be expensive
because this method will also generate  memory usage statistics
by iterating on each page.
This commit intend to offer a more direct access to rss value.

Refs: #33384

PR-URL: https://github.com/nodejs/node/pull/34291
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2021-01-12 07:10:30 -05:00