Skip to content

Commit

Permalink
test: fix flaky test-inspector-connect-main-thread
Browse files Browse the repository at this point in the history
Using `console.log()` likely interferes with the functionality of the
test, which also checks the interaction between inspector
and `console.log()` as part of the test. Using `process._rawDebug()`
solves that issue.

Refs: #28870
Refs: #29582

PR-URL: #29588
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
addaleax authored and targos committed Sep 20, 2019
1 parent ca28c94 commit 3014fb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-inspector-connect-main-thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ async function post(session, method, params) {
session.post(method, params, (error, success) => {
messagesSent.push(method);
if (error) {
console.log(`Message ${method} produced an error`);
process._rawDebug(`Message ${method} produced an error`);
reject(error);
} else {
console.log(`Message ${method} was sent`);
process._rawDebug(`Message ${method} was sent`);
resolve(success);
}
});
Expand Down

0 comments on commit 3014fb5

Please sign in to comment.