From c60711ab15ec60cedd52e12f4ac2544deb0b85df Mon Sep 17 00:00:00 2001 From: Svarog Date: Thu, 29 Aug 2019 15:27:03 +0300 Subject: [PATCH] [NOD-302] Accept ConnectionEstablished when Pending is expected in TestRetryPermanent (#388) --- connmgr/connmanager_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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