From 600cd28167bc465440f8ec9beff38eb8d7302f5d Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Wed, 17 Apr 2013 23:59:49 +0200 Subject: [PATCH] test: make stdout-close-unref work in test runner process.stdout isn't fully initialized yet by the time the test starts when invoked with `python tools/test.py`. Use process.stdin instead and force initialization with process.stdin.resume(). This is a back-port of commit 2e70dda from the v0.10 branch. --- test/simple/test-stdout-close-unref.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/simple/test-stdout-close-unref.js b/test/simple/test-stdout-close-unref.js index 533a0059367..42f399772f3 100644 --- a/test/simple/test-stdout-close-unref.js +++ b/test/simple/test-stdout-close-unref.js @@ -19,5 +19,6 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -process.stdout._handle.close(); -process.stdout._handle.unref(); // Should not segfault. +process.stdin.resume(); +process.stdin._handle.close(); +process.stdin._handle.unref(); // Should not segfault.