Skip to content

Commit

Permalink
Adding a retry to startprotocol to avoid <context deadline exceeded> …
Browse files Browse the repository at this point in the history
…errors
  • Loading branch information
nsadhasivam committed Sep 10, 2024
1 parent c5b17ab commit bd54de8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion otg/otg.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,16 @@ func (o *OTG) StartProtocols(t testing.TB) {
t = events.ActionStarted(t, "Starting protocols on %s", o.ate)
warns, err := o.setProtocolState(context.Background(), gosnappi.StateProtocolAllState.START)
if err != nil {
t.Fatalf("StartProtocols(t) on %s: %v", o.ate, err)
time.Sleep(1 * time.Minute)
t.Helper()
t = events.ActionStarted(t, "Retry Starting protocols on %s", o.ate)
warnsRetry, errRetry := o.setProtocolState(context.Background(), gosnappi.StateProtocolAllState.START)
if errRetry != nil {
t.Fatalf("Retry StartProtocols(t) on %s: %v", o.ate, errRetry)
}
if len(warnsRetry) > 0 {
t.Logf("StartProtocols(t) on %s non-fatal warnings on retry: %v", o.ate, warnsRetry)
}
}
if len(warns) > 0 {
t.Logf("StartProtocols(t) on %s non-fatal warnings: %v", o.ate, warns)
Expand Down

0 comments on commit bd54de8

Please sign in to comment.