packer: try to fix flaky test

This commit is contained in:
Mitchell Hashimoto 2015-05-28 15:13:10 -07:00
parent 590997df44
commit da694a6ea8
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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())
}