summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-04-17 23:59:49 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2013-04-18 00:05:31 +0200
commit600cd28167bc465440f8ec9beff38eb8d7302f5d (patch)
tree9d8ef0eefc61ce5b736584683c83ab1a8463a9dd
parent0801a1889076f1fe930bfac78097859bb83441d6 (diff)
downloadnode-600cd28167bc465440f8ec9beff38eb8d7302f5d.tar.gz
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.
-rw-r--r--test/simple/test-stdout-close-unref.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/simple/test-stdout-close-unref.js b/test/simple/test-stdout-close-unref.js
index 533a00593..42f399772 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.