More tweaks to tests... just about ready to run at scale.

This commit is contained in:
Adam Ierymenko 2015-10-28 14:24:54 -07:00
parent 9653531242
commit 4c24e0cfb0
3 changed files with 7 additions and 5 deletions

1
.gitignore vendored
View file

@ -53,6 +53,7 @@ node_modules
cluster-geo/cluster-geo/config.js cluster-geo/cluster-geo/config.js
cluster-geo/cluster-geo/cache.* cluster-geo/cluster-geo/cache.*
tests/http/zerotier-one tests/http/zerotier-one
tests/http/result_*
# MacGap wrapper build files # MacGap wrapper build files
/ext/mac-ui-macgap1-wrapper/src/MacGap.xcodeproj/project.xcworkspace/xcuserdata/* /ext/mac-ui-macgap1-wrapper/src/MacGap.xcodeproj/project.xcworkspace/xcuserdata/*

View file

@ -217,6 +217,7 @@ var expressServer = app.listen(AGENT_PORT,agentIdToIp(thisAgentId),function () {
console.error('FATAL: unable to contact or query server: '+err.toString()); console.error('FATAL: unable to contact or query server: '+err.toString());
process.exit(1); process.exit(1);
} }
doTestsAndReport();
setInterval(doTestsAndReport,TEST_INTERVAL); setInterval(doTestsAndReport,TEST_INTERVAL);
}); });
}); });

View file

@ -41,15 +41,15 @@ app.post('/:testNumber/:agentId',function(req,res) {
} }
result = { result = {
agentId: agentId, agentId: agentId,
testNumber: testNumber, testNumber: parseInt(testNumber),
receiveTime: receiveTime, receiveTime: receiveTime,
results: resultData results: resultData
}; };
var nows = receiveTime.toString(16); testNumber = testNumber.toString();
while (nows.length < 16) while (testNumber.length < 10)
nows = '0' + nows; testNumber = '0' + testNumber;
fs.writeFile('result_'+agentId+'_'+nows,JSON.stringify(result),function(err) { fs.writeFile('result_'+testNumber+'_'+agentId,JSON.stringify(result),function(err) {
console.log(result); console.log(result);
}); });