Skip to content

Commit

Permalink
chore(tests) remove misleading log
Browse files Browse the repository at this point in the history
Remove a log that would emit during an expected test shutdown condition.
This suggested that condition was the problem, rather than other
problems earlier.
  • Loading branch information
rainest committed Oct 2, 2023
1 parent c20f503 commit aaa811a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/envtest/telemetry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ func TestTelemetry(t *testing.T) {
waitTime = 3 * time.Second
tickTime = 10 * time.Millisecond
)
require.Eventually(t, func() bool {
require.Eventuallyf(t, func() bool {
select {
case report := <-reportChan:
return verifyTelemetryReport(t, k8sVersion, string(report))
case <-time.After(tickTime):
return false
}
}, waitTime, tickTime)
}, waitTime, tickTime, "telemetry report never matched expected value")
}

func configForEnvTestTelemetry(t *testing.T, envcfg *rest.Config, splunkEndpoint string, telemetryPeriod time.Duration) manager.Config {
Expand Down Expand Up @@ -340,7 +340,8 @@ func verifyTelemetryReport(t *testing.T, k8sVersion *version.Info, report string
for _, s := range []string{"id", "uptime"} {
report, err = removeStanzaFromReport(report, s)
if err != nil {
t.Logf("failed to remove stanza %q from report: %s", s, err)
// this normally happens during shutdown, when the report is an empty string
// no point in proceeding if so
return false
}
}
Expand Down

0 comments on commit aaa811a

Please sign in to comment.