From 71d7c85b6be3db4f9007692835742dfc56ce219c Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Thu, 4 May 2017 18:24:59 -0700 Subject: [PATCH] expect: reload DEBUG_EXPECT for each process Lets e2e test cases selectively turn on expect debugging to get full application output written to stdout. --- pkg/expect/expect.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/expect/expect.go b/pkg/expect/expect.go index a58121ccf..fe27ef7fe 100644 --- a/pkg/expect/expect.go +++ b/pkg/expect/expect.go @@ -44,8 +44,6 @@ type ExpectProcess struct { StopSignal os.Signal } -var printDebugLines = os.Getenv("EXPECT_DEBUG") != "" - // NewExpect creates a new process for expect testing. func NewExpect(name string, arg ...string) (ep *ExpectProcess, err error) { // if env[] is nil, use current system env @@ -75,6 +73,7 @@ func NewExpectWithEnv(name string, args []string, env []string) (ep *ExpectProce func (ep *ExpectProcess) read() { defer ep.wg.Done() + printDebugLines := os.Getenv("EXPECT_DEBUG") != "" r := bufio.NewReader(ep.fpty) for ep.err == nil { ep.ptyMu.Lock()