Skip to content

Commit

Permalink
Log timed out bench requests
Browse files Browse the repository at this point in the history
  • Loading branch information
Stiliyan Lazarov committed May 28, 2019
1 parent 15fad6b commit 1762655
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/profiling/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@ const store = HA(settings.setup);
function handleRequest(id, language) {
let finished = false;
const before = Date.now();
setTimeout(() => {
//if (finished === false) suite.timeouts++;
const timeout = setTimeout(() => {
if (finished === false) {
suite.timeouts++;
console.log(`request timed out: { id: ${id}, lang: ${language}}`);
}
}, 500);
store.get(id, { language }, crypto.randomBytes(8).toString('hex'))
.then((result) => {
clearTimeout(timeout);
finished = true;
if (!result || result.id !== id || result.language !== language) {
throw new Error(`Integrity test failed: ${result} does not match {${id} ${language}}`);
Expand Down

0 comments on commit 1762655

Please sign in to comment.