From 2c41723e1c1c9370f61e219159122db202420e41 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 18 Aug 2016 20:17:16 -0700 Subject: [PATCH] test: refactor test-tick-processor The test does some extra work that isn't necessary because of the way temp directories are handled. The test removes all files from the temp directory with `common.refreshTmpDir()` but still filters the results even though only its files will be in the directory). Refactor to remove that unneeded logic. PR-URL: https://github.com/nodejs/node/pull/8180 Reviewed-By: Evan Lucas Reviewed-By: Jeremiah Senkpiel Reviewed-By: James M Snell --- test/parallel/test-tick-processor.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/parallel/test-tick-processor.js b/test/parallel/test-tick-processor.js index 71f573deceb3be..78fb2526fa6cfc 100644 --- a/test/parallel/test-tick-processor.js +++ b/test/parallel/test-tick-processor.js @@ -45,12 +45,10 @@ runTest(/RunInDebugContext/, function runTest(pattern, code) { cp.execFileSync(process.execPath, ['-prof', '-pe', code]); - var matches = fs.readdirSync(common.tmpDir).filter(function(file) { - return /^isolate-/.test(file); - }); - if (matches.length != 1) { - common.fail('There should be a single log file.'); - } + var matches = fs.readdirSync(common.tmpDir); + + assert.strictEqual(matches.length, 1, 'There should be a single log file.'); + var log = matches[0]; var out = cp.execSync(process.execPath + ' --prof-process --call-graph-size=10 ' + log,