test: refactor test-dgram-send-callback-recursive
authorSantiago Gimeno <santiago.gimeno@gmail.com>
Thu, 4 Feb 2016 17:33:44 +0000 (18:33 +0100)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
commit274e781f8f7f08ab10bcb4232af825c9597b8219
treee6079defa4a21508472ba206e095fa12cd153b76
parenta44aa391365487d94ac7e252045b470e68625cf0
test: refactor test-dgram-send-callback-recursive

Just send 10 messages recursively and check that the send calls are
asynchronous by asserting that a `setImmediate` callback has been called
in-between. It avoids a race condition in the test when the recursive
limit is reached without having received at least 10 messages.

Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/5079
test/parallel/test-dgram-send-callback-recursive.js