From 9ac66375a041eb28087213804226f73689c0bbde Mon Sep 17 00:00:00 2001 From: Luke Tomlinson Date: Fri, 21 May 2021 15:32:09 -0400 Subject: [PATCH] Fix flakey test (#817) --- packages/exec/__tests__/scripts/stdoutputspecial.js | 5 ++++- packages/exec/src/exec.ts | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/exec/__tests__/scripts/stdoutputspecial.js b/packages/exec/__tests__/scripts/stdoutputspecial.js index 21bc5e1f..6a641cd0 100644 --- a/packages/exec/__tests__/scripts/stdoutputspecial.js +++ b/packages/exec/__tests__/scripts/stdoutputspecial.js @@ -1,5 +1,8 @@ //first half of © character process.stdout.write(Buffer.from([0xC2]), (err) => { //write in the callback so that the second byte is sent separately - process.stdout.write(Buffer.from([0xA9])) //second half of © character + setTimeout(() => { + process.stdout.write(Buffer.from([0xA9])) //second half of © character + }, 5000) + }) diff --git a/packages/exec/src/exec.ts b/packages/exec/src/exec.ts index 92b5d8e7..2a67a912 100644 --- a/packages/exec/src/exec.ts +++ b/packages/exec/src/exec.ts @@ -82,7 +82,6 @@ export async function getExecOutput( stdout += stdoutDecoder.end() stderr += stderrDecoder.end() - //return undefined for stdout/stderr if they are empty return { exitCode, stdout,