From fade7a506a95c12617ae8e055620242f0bc684ba Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Fri, 6 Jul 2018 16:09:29 +0200 Subject: [PATCH] Avoid using readPipeBlockingMulti (see clean-and-itasks/clean-platform#53) --- cleantest.icl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cleantest.icl b/cleantest.icl index aa5e8fe..df12b3a 100644 --- a/cleantest.icl +++ b/cleantest.icl @@ -385,9 +385,12 @@ where readPipes :: !*ProcessOutput !ProcessIO !*File !*World -> *(!MaybeOSError Bool, !*ProcessOutput, !*File, !*World) readPipes output pio io w - # (ss,w) = readPipeBlockingMulti [pio.stdOut, pio.stdErr] w - | isError ss - # oserr=:(err,msg) = fromError ss + # (out,w) = readPipeBlocking pio.stdOut w + # (err,w) = readPipeNonBlocking pio.stdErr w + | isError out || isError err + # oserr=:(err,msg) = case out of + Error e -> e + _ -> fromError err # event = Failed Nothing # io = emit (EndEvent { name = r.TestRun.name @@ -395,7 +398,8 @@ where , message = "Failed to read child process IO (" <+ err <+ "; " <+ msg <+ ")" }) io = (Error oserr, output, io, w) - # [out,err:_] = fromOk ss + # out = fromOk out + # err = fromOk err # (output,(continue,io)) = append out (\s (continue,io) | not continue && opts.stop_on_first_failure -- GitLab