[NOD-302] Accept ConnectionEstablished when Pending is expected in TestRetryPermanent (#388)

This commit is contained in:
Svarog 2019-08-29 15:27:03 +03:00 committed by Ori Newman
parent 1b00e01030
commit c60711ab15

View File

@ -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