Per review in #4889-17:
Updated the CopyPipeToChan error message to be more descriptive, for the
benefit of anyone reading log output.
Corrected the test to confirm that the error message is received even if
the child process does not close the stderr log (which matches the usage
patterns in production).
out <- s.Text()
}
if s.Err() != nil {
- out <- fmt.Sprintf("CopyPipeToChan: %s", s.Err())
+ out <- fmt.Sprintf("crunchstat: line buffering error: %s", s.Err())
}
done <- true
}
long_line[i] = byte('x')
}
pipeOut.Write(long_line)
- pipeOut.Close()
}()
// Expect error message from logChan.
errmsg := <-logChan
- if matched, err := regexp.MatchString("^CopyPipeToChan:.*token too long", errmsg); err != nil || !matched {
+ if matched, err := regexp.MatchString("^crunchstat: line buffering error:.*token too long", errmsg); err != nil || !matched {
t.Fatalf("expected CopyPipeToChan error, got %s", errmsg)
}