MCPcopy Create free account
hub / github.com/PostHog/duckgres / TestIsWorkerConnPoolTimeoutError

Function TestIsWorkerConnPoolTimeoutError

controlplane/session_mgr_test.go:735–752  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

733}
734
735func TestIsWorkerConnPoolTimeoutError(t *testing.T) {
736 // The exact wedged-worker signature observed live (e2e ci-pr-759, worker 26:
737 // 12 straight client retries deterministically reused the same hot-idle
738 // wedged worker). The CP must classify it for recycle-and-reacquire.
739 err := fmt.Errorf("create session: %w",
740 fmt.Errorf("create session on worker 26: create session recv: %w",
741 errors.New("rpc error: code = ResourceExhausted desc = create session: failed to obtain connection from pool (timeout after 30s): context deadline exceeded")))
742 if !isWorkerConnPoolTimeoutError(err) {
743 t.Fatal("wedged-worker pool-timeout error not classified for recycle")
744 }
745 // Cap errors and unrelated errors must not match.
746 if isWorkerConnPoolTimeoutError(errors.New("max sessions reached (1)")) {
747 t.Fatal("cap error misclassified as pool timeout")
748 }
749 if isWorkerConnPoolTimeoutError(nil) {
750 t.Fatal("nil misclassified")
751 }
752}
753
754func TestIsWorkerS3CacheRestoreError(t *testing.T) {
755 // The worker-side mandatory restore failure as it reaches the CP through

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected