mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
test: deflake test-common-expect-warning
The subprocess might exit before the data is flushed. Run the assertion after the `'end'` event is emitted. PR-URL: https://github.com/nodejs/node/pull/42046 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
1 parent
663a669b0b
commit
626367c4e3
1 file changed
+3
-1
@@ -36,9 +36,11 @@ if (process.argv[2] !== 'child') {
|
||||
child.stderr.on('data', (data) => {
|
||||
stderr += data;
|
||||
});
|
||||
child.stderr.on('end', common.mustCall(() => {
|
||||
assert.match(stderr, /Unexpected extra warning received/);
|
||||
}));
|
||||
child.on('exit', common.mustCall((status) => {
|
||||
assert.notStrictEqual(status, 0);
|
||||
assert.match(stderr, /Unexpected extra warning received/);
|
||||
}));
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user