diff options
author | Rich Trott <rtrott@gmail.com> | 2017-12-21 15:04:24 -0800 |
---|---|---|
committer | Anatoli Papirovski <apapirovski@mac.com> | 2017-12-24 09:21:37 -0500 |
commit | d610fad39018a7f21904f2f8fa496c21472f05cb (patch) | |
tree | 5c575856ad12de79f9f50a0118a690b2676b4d5a /benchmark/fs | |
parent | 4444b6b9add0a202dec319471630f724a219675c (diff) | |
download | node-new-d610fad39018a7f21904f2f8fa496c21472f05cb.tar.gz |
benchmark: make temp file path configurable
In three fs benchmarks, a temp file is created in the source tree. For
tests, allow the location to be configurable so it gets written to the
test temp directory instead.
Additionally, shave about a second off the test running time by setting
`dur` to `0.1` instead of `1`.
PR-URL: https://github.com/nodejs/node/pull/17811
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Diffstat (limited to 'benchmark/fs')
-rw-r--r-- | benchmark/fs/read-stream-throughput.js | 2 | ||||
-rw-r--r-- | benchmark/fs/readfile.js | 2 | ||||
-rw-r--r-- | benchmark/fs/write-stream-throughput.js | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/benchmark/fs/read-stream-throughput.js b/benchmark/fs/read-stream-throughput.js index 162cef6864..e0dc7edc05 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 82479ff14e..7c55073fe0 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 5c6464fdbb..c61b590011 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'); |