From 1762655fafb974373f5fa27186369c089911abf2 Mon Sep 17 00:00:00 2001 From: Stiliyan Lazarov Date: Tue, 28 May 2019 14:16:07 -0400 Subject: [PATCH] Log timed out bench requests --- tests/profiling/worker.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/profiling/worker.js b/tests/profiling/worker.js index 35ff51c..4725e50 100644 --- a/tests/profiling/worker.js +++ b/tests/profiling/worker.js @@ -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}}`);