bootstrap: trim redundant batchable-error test cases · Entire

bootstrap: trim redundant batchable-error test cases

d8d64e6→main·

Soph·1mo ago·1 file·+3 added/-4 removed

Per-status edge cases are already owned by TestIsTargetBodyLimitError and TestIsTargetPushDeadlineError; the combinator test only needs to confirm the OR wires both predicates in.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Sessions

77e6d8947321View transcript

?\ can you take a look at https://github.com/entireio/git-sync/issues/70Claude Code·Opus 4.8[1m]·1 step

Changes

1

185 unmodified lines

186
187
188
189
190
191
192
193
194
195
194
196
196
197
198
197
198
199
200

185 unmodified lines

}

func TestIsBatchableTargetPushError(t *testing.T) {
    // Per-status edge cases are covered by TestIsTargetBodyLimitError and
    // TestIsTargetPushDeadlineError; this only confirms the OR wires both in.
    tests := []struct {
        name string
        err  error
        want bool
    }{
        {name: "nil error", err: nil, want: false},
        {name: "body limit", err: errors.New("body exceeded size limit 1048576"), want: true},
        {name: "http 413", err: errors.New("http 413"), want: true},
        {name: "http 408 deadline", err: errors.New("http 408: request timeout"), want: true},
        {name: "http 504 deadline", err: errors.New("http 504: gateway timeout"), want: true},
        {name: "deadline", err: errors.New("http 408: request timeout"), want: true},
        {name: "unrelated", err: errors.New("connection refused"), want: false},
    }