From b0409f45bd7dd725498b1c9308762b7fb9a7c012 Mon Sep 17 00:00:00 2001 From: Yousaf Nabi Date: Tue, 28 May 2024 22:34:41 +0100 Subject: [PATCH] fix: set process.stdout._handle.setBlocking(true) on ffi init 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 {