MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / TestHasReachedMaxRetryAttempt

Function TestHasReachedMaxRetryAttempt

cmd/workers_test.go:10–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestHasReachedMaxRetryAttempt(t *testing.T) {
11 cfg := &config.Configuration{
12 Queue: config.QueueConfig{
13 MaxRetryAttempts: 5,
14 },
15 }
16
17 tests := []struct {
18 name string
19 retryCount int
20 want bool
21 }{
22 {name: "below max", retryCount: 4, want: false},
23 {name: "at max", retryCount: 5, want: true},
24 {name: "above max", retryCount: 6, want: true},
25 }
26
27 for _, tt := range tests {
28 t.Run(tt.name, func(t *testing.T) {
29 if got := hasReachedMaxRetryAttempt(cfg, tt.retryCount); got != tt.want {
30 t.Fatalf("hasReachedMaxRetryAttempt() = %v, want %v", got, tt.want)
31 }
32 })
33 }
34}
35
36func TestShouldRejectLockContentionImmediately(t *testing.T) {
37 cfg := &config.Configuration{

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected