From ad47ae7608b23c80739474de6241662af92ce63c Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 10 Oct 2018 22:14:37 -0700 Subject: [PATCH] test: add logging to test-worker-memory To help troubleshoot CI failures, add some logging. Refs: https://github.com/nodejs/node/issues/23277#issuecomment-428819187 PR-URL: https://github.com/nodejs/node/pull/23418 Reviewed-By: Anna Henningsen Reviewed-By: Gireesh Punathil Reviewed-By: Sakthipriyan Vairamani --- test/parallel/test-worker-memory.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/parallel/test-worker-memory.js b/test/parallel/test-worker-memory.js index 3c7627b02cbe43..c70f12c7b3f9c0 100644 --- a/test/parallel/test-worker-memory.js +++ b/test/parallel/test-worker-memory.js @@ -10,6 +10,7 @@ const numWorkers = +process.env.JOBS || require('os').cpus().length; // Verify that a Worker's memory isn't kept in memory after the thread finishes. function run(n, done) { + console.log(`run() called with n=${n} (numWorkers=${numWorkers})`); if (n <= 0) return done(); const worker = new Worker( @@ -27,6 +28,7 @@ const startStats = process.memoryUsage(); let finished = 0; for (let i = 0; i < numWorkers; ++i) { run(60 / numWorkers, () => { + console.log(`done() called (finished=${finished})`); if (++finished === numWorkers) { const finishStats = process.memoryUsage(); // A typical value for this ratio would be ~1.15.