Skip to content

Commit 2c11718

Browse files
committed
Add some debug output to test-child-process-double-pipe
1 parent 3a219de commit 2c11718

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/simple/test-child-process-double-pipe.js

+15
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ var echo = spawn('echo', ['hello\nnode\nand\nworld\n']),
4444

4545
// pipe echo | grep
4646
echo.stdout.on('data', function(data) {
47+
console.error("grep stdin write " + data.length);
4748
if (!grep.stdin.write(data)) {
4849
echo.stdout.pause();
4950
}
@@ -58,10 +59,23 @@ echo.stdout.on('end', function(code) {
5859
grep.stdin.end();
5960
});
6061

62+
echo.on('exit', function() {
63+
console.error("echo exit");
64+
})
65+
66+
grep.on('exit', function() {
67+
console.error("grep exit");
68+
})
69+
70+
sed.on('exit', function() {
71+
console.error("sed exit");
72+
})
73+
6174

6275

6376
// pipe grep | sed
6477
grep.stdout.on('data', function(data) {
78+
console.error("grep stdout " + data.length);
6579
if (!sed.stdin.write(data)) {
6680
grep.stdout.pause();
6781
}
@@ -73,6 +87,7 @@ sed.stdin.on('drain', function(data) {
7387

7488
// propagate end from grep to sed
7589
grep.stdout.on('end', function(code) {
90+
console.error("grep stdout end");
7691
sed.stdin.end();
7792
});
7893

0 commit comments

Comments
 (0)