(t *testing.T, sm *SessionManager, want int)
| 547 | } |
| 548 | |
| 549 | func waitForConnectionWaiters(t *testing.T, sm *SessionManager, want int) { |
| 550 | t.Helper() |
| 551 | deadline := time.Now().Add(time.Second) |
| 552 | for time.Now().Before(deadline) { |
| 553 | sm.mu.RLock() |
| 554 | got := len(sm.waiters) |
| 555 | sm.mu.RUnlock() |
| 556 | if got == want { |
| 557 | return |
| 558 | } |
| 559 | time.Sleep(time.Millisecond) |
| 560 | } |
| 561 | sm.mu.RLock() |
| 562 | got := len(sm.waiters) |
| 563 | sm.mu.RUnlock() |
| 564 | t.Fatalf("timed out waiting for %d connection waiters, got %d", want, got) |
| 565 | } |
| 566 | |
| 567 | func TestSessionManager_ConnectionLimits_FIFO(t *testing.T) { |
| 568 | ctx := context.Background() |
no test coverage detected