diff --git a/benchmark/fs/read-stream-throughput.js b/benchmark/fs/read-stream-throughput.js index 162cef6864a686..e0dc7edc05ea3e 100644 --- a/benchmark/fs/read-stream-throughput.js +++ b/benchmark/fs/read-stream-throughput.js @@ -3,7 +3,7 @@ const path = require('path'); const common = require('../common.js'); -const filename = path.resolve(__dirname, +const filename = path.resolve(process.env.NODE_TMPDIR || __dirname, `.removeme-benchmark-garbage-${process.pid}`); const fs = require('fs'); const assert = require('assert'); diff --git a/benchmark/fs/readfile.js b/benchmark/fs/readfile.js index 82479ff14e5f68..7c55073fe0f017 100644 --- a/benchmark/fs/readfile.js +++ b/benchmark/fs/readfile.js @@ -5,7 +5,7 @@ const path = require('path'); const common = require('../common.js'); -const filename = path.resolve(__dirname, +const filename = path.resolve(process.env.NODE_TMPDIR || __dirname, `.removeme-benchmark-garbage-${process.pid}`); const fs = require('fs'); diff --git a/benchmark/fs/write-stream-throughput.js b/benchmark/fs/write-stream-throughput.js index 5c6464fdbb2cbb..c61b5900111411 100644 --- a/benchmark/fs/write-stream-throughput.js +++ b/benchmark/fs/write-stream-throughput.js @@ -3,7 +3,7 @@ const path = require('path'); const common = require('../common.js'); -const filename = path.resolve(__dirname, +const filename = path.resolve(process.env.NODE_TMPDIR || __dirname, `.removeme-benchmark-garbage-${process.pid}`); const fs = require('fs'); diff --git a/test/parallel/test-benchmark-fs.js b/test/parallel/test-benchmark-fs.js index eeac59fdab06ac..415eb1896b69a8 100644 --- a/test/parallel/test-benchmark-fs.js +++ b/test/parallel/test-benchmark-fs.js @@ -1,12 +1,12 @@ 'use strict'; -require('../common'); +const common = require('../common'); const runBenchmark = require('../common/benchmark'); runBenchmark('fs', [ 'n=1', 'size=1', - 'dur=1', + 'dur=0.1', 'len=1024', 'concurrent=1', 'pathType=relative', @@ -14,4 +14,4 @@ runBenchmark('fs', [ 'statSyncType=fstatSync', 'encodingType=buf', 'filesize=1024' -]); +], { NODE_TMPDIR: common.tmpDir });