test: fix race in parallel/test-vm-debug-context
authorBen Noordhuis <info@bnoordhuis.nl>
Sun, 29 Mar 2015 18:09:22 +0000 (20:09 +0200)
committerBen Noordhuis <info@bnoordhuis.nl>
Sun, 29 Mar 2015 22:29:28 +0000 (00:29 +0200)
commit8d1c87ea0a0534d42938f1f8804c48cf6599f617
tree3136392edd9bc78b5a5d0f88a940c94f0388a2a3
parentea37ac04f4e4e9248fb361d65a3cd69f57bcaba1
test: fix race in parallel/test-vm-debug-context

Fix a race condition in parallel/test-vm-debug-context where the 'exit'
event for the child process is emitted before the first and only 'data'
event for the child process's stderr stream.

I considered deferring the 'exit' event in lib/child_process.js until
all stdio streams have been closed but I realized that's not going to
work when the child process spins off grandchildren that keep the stdio
file descriptors alive.

Fixes: https://github.com/iojs/io.js/issues/1291
PR-URL: https://github.com/iojs/io.js/pull/1294
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
test/parallel/test-vm-debug-context.js