summaryrefslogtreecommitdiff
path: root/benchmark/http
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-12-24 22:38:11 -0800
committerRich Trott <rtrott@gmail.com>2018-01-31 22:11:07 -0800
commitbf6ce47259ebfe9f6349c223cc1735726aee062d (patch)
tree2f40f8e9618a253862cf1f0953992c8c16b56772 /benchmark/http
parent6035beea93e16f6d923201a33a541f6d724f00d6 (diff)
downloadandroid-node-v8-bf6ce47259ebfe9f6349c223cc1735726aee062d.tar.gz
android-node-v8-bf6ce47259ebfe9f6349c223cc1735726aee062d.tar.bz2
android-node-v8-bf6ce47259ebfe9f6349c223cc1735726aee062d.zip
test: move tmpdir to submodule of common
Move tmpdir functionality to its own module (common/tmpdir). PR-URL: https://github.com/nodejs/node/pull/17856 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'benchmark/http')
-rw-r--r--benchmark/http/http_server_for_chunky_client.js13
1 files changed, 3 insertions, 10 deletions
diff --git a/benchmark/http/http_server_for_chunky_client.js b/benchmark/http/http_server_for_chunky_client.js
index f079544e03..1e5a458366 100644
--- a/benchmark/http/http_server_for_chunky_client.js
+++ b/benchmark/http/http_server_for_chunky_client.js
@@ -2,22 +2,15 @@
const assert = require('assert');
const http = require('http');
-const fs = require('fs');
const { fork } = require('child_process');
const common = require('../common.js');
-const { PIPE, tmpDir } = require('../../test/common');
+const { PIPE } = require('../../test/common');
+const tmpdir = require('../../test/common/tmpdir');
process.env.PIPE_NAME = PIPE;
-try {
- fs.accessSync(tmpDir, fs.F_OK);
-} catch (e) {
- fs.mkdirSync(tmpDir);
-}
+tmpdir.refresh();
var server;
-try {
- fs.unlinkSync(process.env.PIPE_NAME);
-} catch (e) { /* ignore */ }
server = http.createServer(function(req, res) {
const headers = {