joyent/node — pull request #3473 by shigeki (2012-06-18 07:18:13+00:00)
Title: test: fix test-dgram-broadcast-multi-process

The test was failed when a router replies IPADDR_BROADCAST as
````
> ./node test/simple/test-dgram-broadcast-multi-process.js
[CHILD] 5715 received 'First message to send' from {"address":"10.0.2.15","family":"IPv4","port":12346,"size":21}
[CHILD] 5715 received 'First message to send' from {"address":"192.168.56.1","family":"IPv4","port":61611,"size":21}
[PARENT] sent 'First message to send' to 255.255.255.255:12346
[CHILD] 5715 received 'Second message to send' from
(snip)
[CHILD] 5713 received 'Second message to send' from {"address":"192.168.56.1","family":"IPv4","port":61611,"size":22}
[PARENT] 5713 received 4 messages total.
[PARENT] All workers have received the required number of messages. Will now compare.
[PARENT] 5713 received 4 matching messges.
[PARENT] 5714 received 8 matching messges.

assert.js:104
throw new assert.AssertionError({
^
AssertionError: A worker received an invalid multicast message
at /home/ohtsu/tmp/github/node/test/simple/test-dgram-broadcast-multi-process.js:134:22
at Array.forEach (native)
at ChildProcess. (/home/ohtsu/tmp/github/node/test/simple/test-dgram-broadcast-multi-process.js:116:34)
at ChildProcess.EventEmitter.emit (events.js:91:17)
at handleMessage (child_process.js:273:12)
at Pipe.channel.onread (child_process.js:293:9)
`````
Fixed it by binding a socket to the only one address of a non-internal interface firstly appeared.