test: fix infinite loop detection

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>
This commit is contained in:
Yosuke Furukawa 2015-05-12 15:47:45 +09:00 committed by Jeremiah Senkpiel
parent 76937051f8
commit 4e2f999a62

View 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) {