MCPcopy Index your code
hub / github.com/docker/docker-agent / TestIsRetryableStatusCode

Function TestIsRetryableStatusCode

pkg/modelerrors/modelerrors_test.go:112–134  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

110}
111
112func TestIsRetryableStatusCode(t *testing.T) {
113 t.Parallel()
114
115 tests := []struct {
116 statusCode int
117 expected bool
118 }{
119 {500, true}, {502, true}, {503, true}, {504, true}, // Server errors
120 {408, true}, // Request timeout
121 {529, true}, // Anthropic overloaded
122 {429, false}, // Rate limit
123 {400, false}, {401, false}, {403, false}, {404, false}, // Client errors
124 {200, false}, // Not an error
125 {0, false}, // Unknown
126 }
127
128 for _, tt := range tests {
129 t.Run(fmt.Sprintf("status_%d", tt.statusCode), func(t *testing.T) {
130 t.Parallel()
131 assert.Equal(t, tt.expected, isRetryableStatusCode(tt.statusCode), "isRetryableStatusCode(%d)", tt.statusCode)
132 })
133 }
134}
135
136func TestIsContextOverflowError(t *testing.T) {
137 t.Parallel()

Callers

nothing calls this directly

Calls 2

isRetryableStatusCodeFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected