Skip to content

Commit

Permalink
test: make stdout-close-unref work in test runner
Browse files Browse the repository at this point in the history
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().
  • Loading branch information
bnoordhuis committed Apr 17, 2013
1 parent 36503b5 commit 2e70dda
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/simple/test-stdout-close-unref.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit 2e70dda

Please sign in to comment.