diff options
author | Rich Trott <rtrott@gmail.com> | 2018-06-04 11:34:09 +0200 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-06-06 14:41:26 -0700 |
commit | 75e91659887012f743aa4487d6d4ce3d765c028a (patch) | |
tree | 5f74d4b91011ecf8e5d05d94449315e8e1608847 /test | |
parent | 227ca87abb9c3a30e13152426c0efc442d908345 (diff) | |
download | android-node-v8-75e91659887012f743aa4487d6d4ce3d765c028a.tar.gz android-node-v8-75e91659887012f743aa4487d6d4ce3d765c028a.tar.bz2 android-node-v8-75e91659887012f743aa4487d6d4ce3d765c028a.zip |
test: improve debug output in trace-events test
test-trace-events-fs-sync is swallowing useful information when it
fails. This change results in more information being displayed.
PR-URL: https://github.com/nodejs/node/pull/21120
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Lance Ball <lball@redhat.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-trace-events-fs-sync.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/parallel/test-trace-events-fs-sync.js b/test/parallel/test-trace-events-fs-sync.js index 491679c9c0..7ab480f14a 100644 --- a/test/parallel/test-trace-events-fs-sync.js +++ b/test/parallel/test-trace-events-fs-sync.js @@ -3,6 +3,7 @@ const common = require('../common'); const assert = require('assert'); const cp = require('child_process'); const fs = require('fs'); +const util = require('util'); if (!common.isMainThread) common.skip('process.chdir is not available in Workers'); @@ -121,7 +122,8 @@ for (const tr in tests) { const proc = cp.spawnSync(process.execPath, [ '--trace-events-enabled', '--trace-event-categories', 'node.fs.sync', - '-e', tests[tr] ]); + '-e', tests[tr] ], + { encoding: 'utf8' }); // Some AIX versions don't support futimes or utimes, so skip. if (common.isAIX && proc.status !== 0 && tr === 'fs.sync.futimes') { continue; @@ -131,7 +133,7 @@ for (const tr in tests) { } // Make sure the operation is successful. - assert.strictEqual(proc.status, 0, tr + ': ' + proc.stderr); + assert.strictEqual(proc.status, 0, `${tr}:\n${util.inspect(proc)}`); // Confirm that trace log file is created. assert(common.fileExists(traceFile)); |