Skip to content

Commit

Permalink
test(profiler): avoid escaping and double newlines in the rendered ou…
Browse files Browse the repository at this point in the history
…tput (#3477)

Change-Id: I0689356803fd9530d34fcb693fc9c2c0fa14c641
  • Loading branch information
aalexand committed Jan 11, 2021
1 parent 3845a0d commit 6ee15fa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions profiler/proftest/proftest.go
Expand Up @@ -472,6 +472,10 @@ func parseBackoffDuration(line string) (time.Duration, error) {
func (tr *GCETestRunner) PollForAndReturnSerialOutput(ctx context.Context, inst *InstanceConfig, finishString, errorString string) (string, error) {
var output string
defer func() {
// Avoid escaping and double newlines in the rendered output (b/175999077).
// TODO: Use strings.ReplaceAll once support for Go 1.11 is dropped.
output = strings.Replace(output, "\r\n", "\n", -1)
output = strings.Replace(output, "\033", "\\033", -1)
log.Printf("Serial port output for %s:\n%s", inst.Name, output)
}()

Expand Down

0 comments on commit 6ee15fa

Please sign in to comment.