From b1314e03f156b7a570ff34d7949f48e86b393204 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 17 Sep 2019 13:50:04 +0200 Subject: [PATCH] test: fix flaky test-inspector-connect-main-thread 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: https://github.com/nodejs/node/pull/28870 Refs: https://github.com/nodejs/node/pull/29582 --- test/parallel/test-inspector-connect-main-thread.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-inspector-connect-main-thread.js b/test/parallel/test-inspector-connect-main-thread.js index 0b072ecf598c32..7f354fb76f9393 100644 --- a/test/parallel/test-inspector-connect-main-thread.js +++ b/test/parallel/test-inspector-connect-main-thread.js @@ -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); } });