Skip to content

Commit

Permalink
epipe test: just use js piping instead of fd sharing
Browse files Browse the repository at this point in the history
For some reason, that's only connecting like half the time.

Really weird.
  • Loading branch information
isaacs committed Aug 23, 2016
1 parent fbc83b0 commit 4a2011f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ t.test('handle EPIPE gracefully', function (t) {
return
}

t.comment('start epipe test')
var nodeHead = [
'var lines = 0',
'process.stdin.on("data", function (c) {',
Expand All @@ -299,9 +300,14 @@ t.test('handle EPIPE gracefully', function (t) {
var head = spawn(node, ['-e', nodeHead], {
stdio: [ 'pipe', 'pipe', 2 ]
})
head.stdout.on('data', function (c) {
t.comment('got output from head bin: %j', c.toString())
})
t.comment('start child')
var child = spawn(node, [run, ok], {
stdio: [ 0, head.stdin, 'pipe' ]
stdio: [ 0, 'pipe', 'pipe' ]
})
child.stdout.pipe(head.stdin)
var err = ''
child.stderr.on('data', function (c) {
console.error('got er data', c+'')
Expand Down

0 comments on commit 4a2011f

Please sign in to comment.