test: fix infinite loop detection
authorYosuke Furukawa <furukawa.yosuke@dena.jp>
Tue, 12 May 2015 06:47:45 +0000 (15:47 +0900)
committerJeremiah Senkpiel <fishrock123@rocketmail.com>
Thu, 14 May 2015 01:31:11 +0000 (21:31 -0400)
Fixes: https://github.com/iojs/io.js/issues/1675
PR-URL: https://github.com/iojs/io.js/pull/1681
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
test/parallel/test-dgram-send-callback-recursive.js

index b1c9745..046545d 100644 (file)
@@ -8,9 +8,10 @@ const chunk = 'abc';
 var recursiveCount = 0;
 var received = 0;
 const limit = 10;
+const recursiveLimit = limit + 1;
 
 function onsend() {
-  if (recursiveCount > limit) {
+  if (recursiveCount > recursiveLimit) {
     throw new Error('infinite loop detected');
   }
   if (received < limit) {