Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2017-04-25 23:48:50 +0300
committerRich Trott <rtrott@gmail.com>2017-04-29 02:18:35 +0300
commita1a54ca3f1c55d3e7fb56fa566c98bc6c0a2dd9a (patch)
treed49352207543eea0c3239c3366553567a9c65dd7 /benchmark/child_process
parentd8f8096ec6e6b9516cd5ca3f046669194ec0984c (diff)
benchmark: terminate child process on Windows
test-benchmark-child-process failures reveal that child-process-exec-stdout benchmark sometimes leaves around a stray yes.exe process. Add code to terminate the process. PR-URL: https://github.com/nodejs/node/pull/12658 Ref: https://github.com/nodejs/node/issues/12560 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'benchmark/child_process')
-rw-r--r--benchmark/child_process/child-process-exec-stdout.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js
index 6b9bebf347c..a30eb92f6ad 100644
--- a/benchmark/child_process/child-process-exec-stdout.js
+++ b/benchmark/child_process/child-process-exec-stdout.js
@@ -10,7 +10,8 @@ const bench = common.createBenchmark(main, {
dur: [5]
});
-const exec = require('child_process').exec;
+const child_process = require('child_process');
+const exec = child_process.exec;
function main(conf) {
bench.start();
@@ -29,7 +30,12 @@ function main(conf) {
});
setTimeout(function() {
- child.kill();
bench.end(bytes);
+ if (process.platform === 'win32') {
+ // Sometimes there's a yes.exe process left hanging around on Windows...
+ child_process.execSync(`taskkill /f /t /pid ${child.pid}`);
+ } else {
+ child.kill();
+ }
}, dur * 1000);
}