Skip to content

Commit

Permalink
more random seeds in test
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Tahler committed Sep 23, 2012
1 parent 24b816d commit 1659495
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions spec/zzz_benchmarks.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,14 @@ function loopingTest(path, data, count, next){
while(counter <= count){
counter++;
process.nextTick(function(){
makeHTTPRequest(path, data, function(response){
var thisData = {}
for(var i in data){
thisData[i] = data[i];
if(typeof thisData[i] == "function"){
thisData[i] = thisData[i]();
}
}
makeHTTPRequest(path, thisData, function(response){
responses++
if(responses == count){
next(false, response);
Expand Down Expand Up @@ -115,7 +122,11 @@ suite.addBatch({
topic: function(){
var cb = this.callback;
startTime = new Date().getTime();
loopingTest('/cacheTest', {key: 'testKey', value: 'testValue'}, 1000, cb)
loopingTest('/cacheTest', { key: function(){
return apiObj.utils.randomString(99);
}, value: function(){
return apiObj.utils.randomString(99);
} }, 1000, cb)
},
'how long?': function(err, lastResponse){
var delta = new Date().getTime() - startTime
Expand Down

0 comments on commit 1659495

Please sign in to comment.