From 2c11718d79bcb63615741f2b5512e133f107a772 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Thu, 11 Aug 2011 16:42:14 -0700 Subject: [PATCH] Add some debug output to test-child-process-double-pipe --- test/simple/test-child-process-double-pipe.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/simple/test-child-process-double-pipe.js b/test/simple/test-child-process-double-pipe.js index 55408ddc85..7322cbefb2 100644 --- a/test/simple/test-child-process-double-pipe.js +++ b/test/simple/test-child-process-double-pipe.js @@ -44,6 +44,7 @@ var echo = spawn('echo', ['hello\nnode\nand\nworld\n']), // pipe echo | grep echo.stdout.on('data', function(data) { + console.error("grep stdin write " + data.length); if (!grep.stdin.write(data)) { echo.stdout.pause(); } @@ -58,10 +59,23 @@ echo.stdout.on('end', function(code) { grep.stdin.end(); }); +echo.on('exit', function() { + console.error("echo exit"); +}) + +grep.on('exit', function() { + console.error("grep exit"); +}) + +sed.on('exit', function() { + console.error("sed exit"); +}) + // pipe grep | sed grep.stdout.on('data', function(data) { + console.error("grep stdout " + data.length); if (!sed.stdin.write(data)) { grep.stdout.pause(); } @@ -73,6 +87,7 @@ sed.stdin.on('drain', function(data) { // propagate end from grep to sed grep.stdout.on('end', function(code) { + console.error("grep stdout end"); sed.stdin.end(); });