From af76abd64b034d2c0e1ffdbe795d68ed8d791b1e Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Wed, 29 May 2024 04:39:54 +0100 Subject: [PATCH] fix: set process.stdout._handle.setBlocking(true) on ffi init (#510) fixes https://github.com/pact-foundation/pact-js/issues/1216 Large number of pact verifications fail when run in parallel --- src/ffi/index.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ffi/index.ts b/src/ffi/index.ts index 74a9f67e..403a1173 100644 --- a/src/ffi/index.ts +++ b/src/ffi/index.ts @@ -88,6 +88,13 @@ let ffi: typeof ffiLib; let ffiLogLevel: LogLevel; const initialiseFfi = (logLevel: LogLevel): typeof ffi => { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + if (process.stdout._handle) { + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + process.stdout._handle.setBlocking(true); + } logger.debug(`Initalising native core at log level '${logLevel}'`); ffiLogLevel = logLevel; try {