Commit da694a6e authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

packer: try to fix flaky test

parent 590997df
......@@ -115,16 +115,16 @@ func (r *RemoteCmd) StartWithUi(c Communicator, ui Ui) error {
}
// Create the channels we'll use for data
exitCh := make(chan int, 1)
exitCh := make(chan struct{})
stdoutCh := iochan.DelimReader(stdout_r, '\n')
stderrCh := iochan.DelimReader(stderr_r, '\n')
// Start the goroutine to watch for the exit
go func() {
defer close(exitCh)
defer stdout_w.Close()
defer stderr_w.Close()
r.Wait()
exitCh <- r.ExitStatus
}()
// Loop and get all our output
......
......@@ -33,7 +33,7 @@ func TestRemoteCmd_StartWithUi(t *testing.T) {
rc.Wait()
expected := strings.TrimSpace(data)
if uiOutput.String() != expected+"\n" {
if strings.TrimSpace(uiOutput.String()) != expected {
t.Fatalf("bad output: '%s'", uiOutput.String())
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment