X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Freal-world%2Freal-world.js;h=12ab06d6d4c030d4a295ae077a464fa755f6c51d;hb=790e65fcf7a0a9f065ecc68c5982efb80cd2e1ca;hp=896ba6cce43c9fdd7e83d2d5778a10a37544b9d0;hpb=f2cdb86675c3783ee903640b5b6f794fa09cdff2;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/real-world/real-world.js b/server/tests/real-world/real-world.js index 896ba6cce..12ab06d6d 100644 --- a/server/tests/real-world/real-world.js +++ b/server/tests/real-world/real-world.js @@ -30,16 +30,16 @@ const removeWeight = program.remove !== undefined ? parseInt(program.remove) : 4 const updateWeight = program.update !== undefined ? parseInt(program.update) : 4 const flushAtExit = program.flush || false const actionInterval = program.action !== undefined ? parseInt(program.action) : 500 -let integrityInterval = program.integrity !== undefined ? parseInt(program.integrity) : 60000 +const integrityInterval = program.integrity !== undefined ? parseInt(program.integrity) : 60000 const displayDiffOnFail = program.integrity || false const numberOfPods = 6 // Wait requests between pods -const baseRequestInterval = integrityInterval < constants.REQUESTS_INTERVAL ? integrityInterval : constants.REQUESTS_INTERVAL +const baseRequestInterval = integrityInterval < constants.REQUESTS_INTERVAL ? constants.REQUESTS_INTERVAL : integrityInterval const requestsMaxPerInterval = baseRequestInterval / actionInterval -const intervalsToMakeAllRequests = Math.ceil(requestsMaxPerInterval / (constants.REQUESTS_LIMIT_PER_POD * numberOfPods)) -const waitForBeforeIntegrityCheck = (intervalsToMakeAllRequests * constants.REQUESTS_INTERVAL) + 1000 +const intervalsToMakeAllRequests = Math.ceil(requestsMaxPerInterval / constants.REQUESTS_LIMIT_PER_POD) +const waitForBeforeIntegrityCheck = (intervalsToMakeAllRequests * constants.REQUESTS_INTERVAL) - integrityInterval + 1000 console.log('Create weight: %d, update weight: %d, remove weight: %d.', createWeight, updateWeight, removeWeight) if (flushAtExit) {