(t *testing.T)
| 733 | } |
| 734 | |
| 735 | func 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 | |
| 754 | func TestIsWorkerS3CacheRestoreError(t *testing.T) { |
| 755 | // The worker-side mandatory restore failure as it reaches the CP through |
nothing calls this directly
no test coverage detected