From ab27a91b07278146975087e873577bed43793554 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 2 Nov 2015 13:53:27 -0800 Subject: [PATCH] . --- tests/http/agent.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/http/agent.js b/tests/http/agent.js index 1d4a43200..bc7c475e6 100644 --- a/tests/http/agent.js +++ b/tests/http/agent.js @@ -4,15 +4,13 @@ // Customizable parameters: // Maximum interval between test attempts -//var TEST_INTERVAL_MAX = (60 * 1 * 1000); -var TEST_INTERVAL_MAX = 1000; +var TEST_INTERVAL_MAX = 60000; // Test timeout in ms var TEST_TIMEOUT = 30000; // Where should I contact to register and query a list of other test agents? -var SERVER_HOST = '127.0.0.1'; -//var SERVER_HOST = '104.238.141.145'; +var SERVER_HOST = '104.238.141.145'; var SERVER_PORT = 18080; // Which port should agents use for their HTTP? @@ -118,9 +116,11 @@ function doTest() } catch (e) {} } - if (allOtherAgents.length > 0) { + if (allOtherAgents.length > 1) { var target = allOtherAgents[Math.floor(Math.random() * allOtherAgents.length)]; + while (target === thisAgentId) + target = allOtherAgents[Math.floor(Math.random() * allOtherAgents.length)]; var testRequest = null; var timeoutId = null; @@ -128,7 +128,7 @@ function doTest() if (testRequest !== null) testRequest.abort(); timeoutId = null; - }); + },TEST_TIMEOUT); var startTime = Date.now(); testRequest = http.get({ @@ -166,7 +166,7 @@ function doTest() }); } else { - return setTimeout(doTest,Math.round(Math.random() * TEST_INTERVAL_MAX) + 1); + return setTimeout(doTest,1000); } });