()
| 2661 | } |
| 2662 | |
| 2663 | func newTestRetryPayload() *codersdk.ChatStreamRetry { |
| 2664 | payload := chaterror.StreamRetryPayload(1, 1500*time.Millisecond, chaterror.ClassifiedError{ |
| 2665 | Message: "OpenAI is rate limiting requests.", |
| 2666 | Kind: codersdk.ChatErrorKindRateLimit, |
| 2667 | Provider: "openai", |
| 2668 | Retryable: true, |
| 2669 | StatusCode: 429, |
| 2670 | }) |
| 2671 | if payload == nil { |
| 2672 | panic("expected retry payload") |
| 2673 | } |
| 2674 | payload.RetryingAt = time.Unix(1_700_000_000, 0).UTC() |
| 2675 | return payload |
| 2676 | } |
| 2677 | |
| 2678 | func TestSubscribeAuthorizedFallsBackToStaleRowWhenRefreshFails(t *testing.T) { |
| 2679 | t.Parallel() |
no test coverage detected