Skip to content

Commit 4e60ce8

Browse files
Trotttargos
authored andcommitted
test: fix flaky test-debug-prompt
Be sure to send `.exit` only once to avoid spurious EPIPE and possibly other errors. Fixes: #21724 PR-URL: #21826 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Minwoo Jung <[email protected]> Reviewed-By: Jon Moss <[email protected]>
1 parent a2edb59 commit 4e60ce8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/sequential/test-debug-prompt.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ const spawn = require('child_process').spawn;
77
const proc = spawn(process.execPath, ['inspect', 'foo']);
88
proc.stdout.setEncoding('utf8');
99

10+
let needToSendExit = true;
1011
let output = '';
1112
proc.stdout.on('data', (data) => {
1213
output += data;
13-
if (output.includes('debug> '))
14+
if (output.includes('debug> ') && needToSendExit) {
1415
proc.stdin.write('.exit\n');
16+
needToSendExit = false;
17+
}
1518
});

0 commit comments

Comments
 (0)