0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
nodejs/benchmark/module
Rich Trott c2cf47a239 benchmark: remove writing to benchmark directory
A benchmark for module loading creates a temporary directory in the
benchmark directory. Re-use the test common module to put the tmp
directory in test instead. This was causing intermittent test failures
because run.js (invoked by benchmark tests, mulitple of which could be
running at once) throws if a subdirectory of benchmark disappears at
just the wrong time.

There are other possible solutions than repurposing the `test/common`
module but two arguments for doing it this way are:

* There is already another benchmark file that does this
  (`http_server_for_chunky_client.js`) so the dependency already exists
  in the benchmarks.
* This also eliminates a re-implementation of rimraf in the benchmark
  code.

PR-URL: https://github.com/nodejs/node/pull/16144
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-10-12 18:16:44 -07:00
..
module-loader.js benchmark: remove writing to benchmark directory 2017-10-12 18:16:44 -07:00