joyent/node — pull request #8045 by misterdjules (2014-07-31 23:56:09+00:00)
Title: tests: improve test-child-process-fork-dgram.

Fixes test-child-process-fork-dgram on the SmartOS jenkins node.

1) Wait for child process to register event handlers on server UDP socket
before sending messages from the parent process.

2) Increase the number of total messages so that both the child and the
master process get a chance to handle at least one of them.

However, this PR looks like a hack for a test case that could fail at anytime depending on how the underlying platform decides to dispatch the messages to the child or the master.

What are we trying to test with this test case? Do we absolutely need both the child and the parent to always handle UDP messages? Could we remove the UDP 'message' event handler as soon as we receive one dgram in the child or the master, so that the one that did not receive a message yet will be the only one that can receive it? This would guarantee (well, as much as UDP can guarantee anything...) that both processes will receive at least one message.