Skip to content

Commit

Permalink
expect: reload DEBUG_EXPECT for each process
Browse files Browse the repository at this point in the history
Lets e2e test cases selectively turn on expect debugging to get
full application output written to stdout.
  • Loading branch information
Anthony Romano committed May 8, 2017
1 parent 3a2e765 commit 21c3669
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/expect/expect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 21c3669

Please sign in to comment.