diff --git a/test/e2e-test/addon-test/main.go b/test/e2e-test/addon-test/main.go index aa6f6830..66ee3262 100644 --- a/test/e2e-test/addon-test/main.go +++ b/test/e2e-test/addon-test/main.go @@ -248,16 +248,9 @@ func enableOneAddon(dir string) error { return err } for { - tmp := make([]byte, 81920) + tmp := make([]byte, 102400) _, err := stdout.Read(tmp) - // Remove enabling countdown, otherwise we cannot see anything in CI logs. - // There are unprintable characters everywhere and the log is huge. - str := strings.Map(func(r rune) rune { - if unicode.IsPrint(r) || r == '\n' { - return r - } - return -1 - }, string(tmp)) + str := convertToString(tmp) if strings.Contains(str, "It is now in phase") { continue } @@ -285,9 +278,10 @@ func disableOneAddon(addonName string) error { return err } for { - tmp := make([]byte, 1024) + tmp := make([]byte, 102400) _, err := stdout.Read(tmp) - fmt.Print(string(tmp)) + str := convertToString(tmp) + fmt.Print(str) if err != nil { break } @@ -347,3 +341,15 @@ func checkPodStatus(namespace string) { fmt.Println(err) } } + +// convertToString converts []byte to string and removes unprintable characters +func convertToString(data []byte) string { + // Remove enabling countdown, otherwise we cannot see anything in CI logs. + // There are unprintable characters everywhere and the log is huge. + return strings.Map(func(r rune) rune { + if unicode.IsPrint(r) || r == '\n' { + return r + } + return -1 + }, string(data)) +}