From bdaf6ce6f8774cf74073fea5a02e3aff4069a28f Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Thu, 5 Oct 2023 10:40:31 +0200 Subject: [PATCH] Fix flaky test in CITGM (#1826) Signed-off-by: Matteo Collina --- test/fixtures/transport-worker.js | 4 +++- test/transport/core.test.js | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/fixtures/transport-worker.js b/test/fixtures/transport-worker.js index 9a7a6ee33..b373a8682 100644 --- a/test/fixtures/transport-worker.js +++ b/test/fixtures/transport-worker.js @@ -1,11 +1,13 @@ 'use strict' const { Writable } = require('stream') +const fs = require('fs') module.exports = (options) => { const myTransportStream = new Writable({ autoDestroy: true, write (chunk, enc, cb) { - console.log(chunk.toString()) + // Bypass console.log() to avoid flakyness + fs.writeSync(1, chunk.toString()) cb() } }) diff --git a/test/transport/core.test.js b/test/transport/core.test.js index 4e5ff459a..75d6760f6 100644 --- a/test/transport/core.test.js +++ b/test/transport/core.test.js @@ -460,7 +460,6 @@ test('stdout in worker', async ({ not }) => { for await (const chunk of child.stdout) { actual += chunk } - await immediate() not(strip(actual).match(/Hello/), null) })