From 3e560e8341c47a5b9d383ef7af5a476bddacea5c Mon Sep 17 00:00:00 2001 From: Patrick Ohly Date: Wed, 19 Oct 2022 17:01:40 +0200 Subject: [PATCH] e2e: remove JSON progress output on stdout The original intention was to address "frustration of end users running the e2e suite is that they take a significant amount of time and it is difficult to gauge progress". But Ginkgo's output is different now than it was in Kubernetes 1.19. If users want to see progress, then "ginkgo --progress" might provide enough information. Printing to os.Stdout doesn't work as intended anyway when output redirection is enabled (the default for parallel runs) and causes these JSON snippets to appear as "show stdout" for each failed test in a Prow job, which is distracting. --- test/e2e/reporters/progress.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/e2e/reporters/progress.go b/test/e2e/reporters/progress.go index 38d5e45b6d2..e06a5532e30 100644 --- a/test/e2e/reporters/progress.go +++ b/test/e2e/reporters/progress.go @@ -62,19 +62,19 @@ func NewProgressReporter(progressReportURL string) *ProgressReporter { return rep } -// SendUpdates serializes the current progress and prints it to stdout and also posts it to the configured endpoint if set. +// SendUpdates serializes the current progress and posts it to the configured endpoint if set. +// It does not print to stdout because that interferes with progress reporting by Ginko +// and (when Ginkgo does output redirection) doesn't actually appear on the screen anyway. func (reporter *ProgressReporter) SendUpdates() { - b := reporter.serialize() - fmt.Println(string(b)) - go reporter.postProgressToURL(b) -} - -func (reporter *ProgressReporter) postProgressToURL(b []byte) { // If a progressURL and client is set/available then POST to it. Noop otherwise. if reporter.client == nil || len(reporter.progressURL) == 0 { return } + b := reporter.serialize() + go reporter.postProgressToURL(b) +} +func (reporter *ProgressReporter) postProgressToURL(b []byte) { resp, err := reporter.client.Post(reporter.progressURL, "application/json", bytes.NewReader(b)) if err != nil { klog.Errorf("Failed to post progress update to %v: %v", reporter.progressURL, err)