diff --git a/connmgr/connmanager_test.go b/connmgr/connmanager_test.go index 0e2e4fdb6..ae47bd0f7 100644 --- a/connmgr/connmanager_test.go +++ b/connmgr/connmanager_test.go @@ -269,7 +269,11 @@ func TestRetryPermanent(t *testing.T) { gotState = cr.State() wantState = ConnPending if gotState != wantState { - t.Fatalf("retry: %v - want state %v, got state %v", cr.Addr, wantState, gotState) + // There is a small chance that connection has already been established, + // so check for that as well + if gotState != ConnEstablished { + t.Fatalf("retry: %v - want state %v, got state %v", cr.Addr, wantState, gotState) + } } gotConnReq = <-connected