diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-11-02 13:53:27 -0800 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-11-02 13:53:27 -0800 |
commit | ab27a91b07278146975087e873577bed43793554 (patch) | |
tree | 596f9b5a434097b7b0580a569e2e471bad194cfd /tests | |
parent | fd3916a49e7923e95c47c70afb8696f110b79951 (diff) | |
download | infinitytier-ab27a91b07278146975087e873577bed43793554.tar.gz infinitytier-ab27a91b07278146975087e873577bed43793554.zip |
.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/http/agent.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/http/agent.js b/tests/http/agent.js index 1d4a4320..bc7c475e 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); } }); |