summaryrefslogtreecommitdiff
path: root/test/parallel/test-trace-events-async-hooks.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/parallel/test-trace-events-async-hooks.js')
-rw-r--r--test/parallel/test-trace-events-async-hooks.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/test/parallel/test-trace-events-async-hooks.js b/test/parallel/test-trace-events-async-hooks.js
index 7c82eb9364..09017e4774 100644
--- a/test/parallel/test-trace-events-async-hooks.js
+++ b/test/parallel/test-trace-events-async-hooks.js
@@ -3,22 +3,20 @@ const common = require('../common');
const assert = require('assert');
const cp = require('child_process');
const fs = require('fs');
+const path = require('path');
const util = require('util');
-if (!common.isMainThread)
- common.skip('process.chdir is not available in Workers');
-
const CODE =
'setTimeout(() => { for (var i = 0; i < 100000; i++) { "test" + i } }, 1)';
-const FILE_NAME = 'node_trace.1.log';
const tmpdir = require('../common/tmpdir');
tmpdir.refresh();
-process.chdir(tmpdir.path);
+const FILE_NAME = path.join(tmpdir.path, 'node_trace.1.log');
const proc = cp.spawn(process.execPath,
[ '--trace-event-categories', 'node.async_hooks',
- '-e', CODE ]);
+ '-e', CODE ],
+ { cwd: tmpdir.path });
proc.once('exit', common.mustCall(() => {
assert(fs.existsSync(FILE_NAME));