Skip to content

Commit

Permalink
retry once when reading logs from k8s cluster
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Seigner <[email protected]>
  • Loading branch information
siggy committed Sep 4, 2019
1 parent 4487989 commit 7d82ccf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/install_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,12 @@ func TestLogs(t *testing.T) {
// does not return 10,000 after 2 seconds. We don't need 10,000 log lines.
outputLines, _ := outputStream.ReadUntil(10000, 2*time.Second)
if len(outputLines) == 0 {
t.Errorf("No logs found for %s", name)
// Retry one time for 30 more seconds, in case the cluster is slow to
// produce log lines.
outputLines, _ = outputStream.ReadUntil(10000, 30*time.Second)
if len(outputLines) == 0 {
t.Errorf("No logs found for %s", name)
}
}

for _, line := range outputLines {
Expand Down

0 comments on commit 7d82ccf

Please sign in to comment.