Skip to content

Commit 1e50d4f

Browse files
committed
fix TestDialerRetryConfiguration/DefaultDialerRetries, because tryDial are likely done in async flow
1 parent 4574888 commit 1e50d4f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

internal/pool/pool_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,9 +508,13 @@ func TestDialerRetryConfiguration(t *testing.T) {
508508
}
509509

510510
// Should have attempted 5 times (default DialerRetries = 5)
511+
// There might be 1 additional attempt due to tryDial() recovery mechanism
511512
finalAttempts := atomic.LoadInt64(&attempts)
512-
if finalAttempts != 5 {
513-
t.Errorf("Expected 5 dial attempts (default), got %d", finalAttempts)
513+
if finalAttempts < 5 {
514+
t.Errorf("Expected at least 5 dial attempts (default), got %d", finalAttempts)
515+
}
516+
if finalAttempts > 6 {
517+
t.Errorf("Expected around 5 dial attempts, got %d (too many)", finalAttempts)
514518
}
515519
})
516520
}

0 commit comments

Comments
 (0)