You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Either stdout: 'ignore' or stderr: 'ignore' (not both)
Then:
result.all is correct
But both result.stdout and result.stderr are empty
The reason is the following. The all option creates childProcess.all, which is usually a PassThrough that reads from both childProcess.stdout and childProcess.stderr. However, with the above conditions, childProcess.all is a reference for either childProcess.stdout or childProcess.stderr instead. This means result.all and result.stdout|stderr read the exact same stream.
We use get-stream, which does readable.read() calls under the hood. When result.all is reading the stream, those chunks are gone, and result.stdout|stderr cannot read them anymore. In other words, result.all and result.stdout|stderr are not sharing the stream, they are competing for it.
On the other hand, when using a PassThrough, things work for the following reason: it relies on listening for data events, which does allow sharing the stream with multiple consumers (as opposed to readable.read()).
This bug was introduced by #646. Our existing tests were missing this specific case. So we need to revert that PR, which is done by #703.
The text was updated successfully, but these errors were encountered:
When using the following options:
all: true
stdout: 'ignore'
orstderr: 'ignore'
(not both)Then:
result.all
is correctresult.stdout
andresult.stderr
are emptyThe reason is the following. The
all
option createschildProcess.all
, which is usually aPassThrough
that reads from bothchildProcess.stdout
andchildProcess.stderr
. However, with the above conditions,childProcess.all
is a reference for eitherchildProcess.stdout
orchildProcess.stderr
instead. This meansresult.all
andresult.stdout|stderr
read the exact same stream.We use
get-stream
, which doesreadable.read()
calls under the hood. Whenresult.all
is reading the stream, those chunks are gone, andresult.stdout|stderr
cannot read them anymore. In other words,result.all
andresult.stdout|stderr
are not sharing the stream, they are competing for it.On the other hand, when using a
PassThrough
, things work for the following reason: it relies on listening fordata
events, which does allow sharing the stream with multiple consumers (as opposed toreadable.read()
).This bug was introduced by #646. Our existing tests were missing this specific case. So we need to revert that PR, which is done by #703.
The text was updated successfully, but these errors were encountered: