[v12.x] Backport #30869 and #31054
The commits land cleanly but there is one test error:
=== release test-stream-pipeline ===
Path: parallel/test-stream-pipeline
Mismatched noop function calls. Expected exactly 1, actual 2.
at Proxy.mustCall (/home/mzasso/git/nodejs/v12.x/test/common/index.js:325:10)
at ClientRequest.<anonymous> (/home/mzasso/git/nodejs/v12.x/test/parallel/test-stream-pipeline.js:502:33)
at Object.onceWrapper (events.js:417:26)
at ClientRequest.emit (events.js:310:20)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:596:27)
at HTTPParser.parserOnHeadersComplete (_http_common.js:119:17)
at Socket.socketOnData (_http_client.js:469:22)
at Socket.emit (events.js:310:20)
at addChunk (_stream_readable.js:295:12)
Command: out/Release/node /home/mzasso/git/nodejs/v12.x/test/parallel/test-stream-pipeline.js
I'm opening this backport PR hoping someone can figure it out.