From 302a26924be04a6d73b6d75e9170c888871efb1b Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 17 Feb 2019 20:59:05 +0100 Subject: [PATCH 1/2] test: increase run time in test-worker-prof This test has occasionally been failing on Windows since it was added, with 6 instead of 15 ticks being seen. Increasing the duration of the test should make it more reliable. --- test/parallel/test-worker-prof.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-worker-prof.js b/test/parallel/test-worker-prof.js index 5b0703f5f9b5ca..d360c35135b33a 100644 --- a/test/parallel/test-worker-prof.js +++ b/test/parallel/test-worker-prof.js @@ -15,7 +15,7 @@ if (!common.isMainThread) if (process.argv[2] === 'child') { const spin = ` const start = Date.now(); - while (Date.now() - start < 200); + while (Date.now() - start < 1000); `; new Worker(spin, { eval: true }); eval(spin); @@ -32,10 +32,11 @@ for (const logfile of logfiles) { const lines = fs.readFileSync(logfile, 'utf8').split('\n'); const ticks = lines.filter((line) => /^tick,/.test(line)).length; - // Test that at least 20 ticks have been recorded for both parent and child + // Test that at least 15 ticks have been recorded for both parent and child // threads. When not tracking Worker threads, only 1 or 2 ticks would // have been recorded. - // When running locally on x64 Linux, this number is usually at least 150 + // When running locally on x64 Linux, this number is usually at least 700 // for both threads, so 15 seems like a very safe threshold. + console.log(ticks) assert(ticks >= 15, `${ticks} >= 15`); } From a56d876f7058c619629742b533610ec4c735f715 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 17 Feb 2019 22:13:44 +0100 Subject: [PATCH 2/2] fixup! test: increase run time in test-worker-prof --- test/parallel/test-worker-prof.js | 1 - 1 file changed, 1 deletion(-) diff --git a/test/parallel/test-worker-prof.js b/test/parallel/test-worker-prof.js index d360c35135b33a..d4344a8057f06f 100644 --- a/test/parallel/test-worker-prof.js +++ b/test/parallel/test-worker-prof.js @@ -37,6 +37,5 @@ for (const logfile of logfiles) { // have been recorded. // When running locally on x64 Linux, this number is usually at least 700 // for both threads, so 15 seems like a very safe threshold. - console.log(ticks) assert(ticks >= 15, `${ticks} >= 15`); }