Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c400448

Browse filesBrowse files
Trotttargos
authored andcommitted
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: #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>
1 parent a4ad989 commit c400448
Copy full SHA for c400448

File tree

Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-2
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-trace-events-fs-sync.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-trace-events-fs-sync.js
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const common = require('../common');
33
const assert = require('assert');
44
const cp = require('child_process');
55
const fs = require('fs');
6+
const util = require('util');
67

78
if (!common.isMainThread)
89
common.skip('process.chdir is not available in Workers');
@@ -121,7 +122,8 @@ for (const tr in tests) {
121122
const proc = cp.spawnSync(process.execPath,
122123
[ '--trace-events-enabled',
123124
'--trace-event-categories', 'node.fs.sync',
124-
'-e', tests[tr] ]);
125+
'-e', tests[tr] ],
126+
{ encoding: 'utf8' });
125127
// Some AIX versions don't support futimes or utimes, so skip.
126128
if (common.isAIX && proc.status !== 0 && tr === 'fs.sync.futimes') {
127129
continue;
@@ -131,7 +133,7 @@ for (const tr in tests) {
131133
}
132134

133135
// Make sure the operation is successful.
134-
assert.strictEqual(proc.status, 0, tr + ': ' + proc.stderr);
136+
assert.strictEqual(proc.status, 0, `${tr}:\n${util.inspect(proc)}`);
135137

136138
// Confirm that trace log file is created.
137139
assert(common.fileExists(traceFile));

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.