Skip to content

Commit

Permalink
Fix metrics service validation
Browse files Browse the repository at this point in the history
Since the cmd block is outside the eventually block, when the same cmd object is used multiple times, we see ´exec: Stdout already set´ error. Moving it inside the eventually block should solve it.
Signed-off-by: Kashif Khan <[email protected]>
  • Loading branch information
kashifest committed Jan 2, 2025
1 parent 8cd8f58 commit 6b58105
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,15 +238,15 @@ var _ = SynchronizedBeforeSuite(func() []byte {
Expect(err).NotTo(HaveOccurred(), "Failed to create ClusterRoleBinding")

By("validating that the metrics service is available")
cmd = exec.Command("kubectl", "get", "service", metricsServiceName, "-n", namespace)
Eventually(func() error {
cmd := exec.Command("kubectl", "get", "service", metricsServiceName, "-n", namespace)
output, err := cmd.CombinedOutput()
if err != nil {
fmt.Printf("Command output: %s\n", string(output))
fmt.Printf("Service check output: %s\n", string(output))
return err
}
return nil
}, "30s", "5s").Should(Succeed())
}, "30s", "5s").Should(Succeed(), "Metrics service is not available")

By("getting the service account token")
token, err := serviceAccountToken()
Expand Down

0 comments on commit 6b58105

Please sign in to comment.