Skip to content

Commit

Permalink
test: refactor test-tick-processor
Browse files Browse the repository at this point in the history
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: #8180
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
Trott authored and MylesBorins committed Oct 26, 2016
1 parent 1c81c07 commit a83bbaa
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/parallel/test-tick-processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a83bbaa

Please sign in to comment.