@@ -37,10 +37,10 @@ func TestCircuitBreaker_ClosedToOpen_FailureRate(t *testing.T) {
3737
3838 // Execute 10 calls: 6 failures (60% failure rate) should open circuit
3939 for i := 0 ; i < 6 ; i ++ {
40- cb .execute (ctx , failFunc )
40+ _ = cb .execute (ctx , failFunc )
4141 }
4242 for i := 0 ; i < 4 ; i ++ {
43- cb .execute (ctx , successFunc )
43+ _ = cb .execute (ctx , successFunc )
4444 }
4545
4646 // Circuit should be open (60% > 50% threshold)
@@ -66,7 +66,7 @@ func TestCircuitBreaker_MinimumCallsRequired(t *testing.T) {
6666
6767 // Execute 10 failures (less than minimum)
6868 for i := 0 ; i < 10 ; i ++ {
69- cb .execute (ctx , failFunc )
69+ _ = cb .execute (ctx , failFunc )
7070 }
7171
7272 // Circuit should still be closed (not enough calls)
@@ -76,7 +76,7 @@ func TestCircuitBreaker_MinimumCallsRequired(t *testing.T) {
7676
7777 // Execute 10 more failures (now 20 total, 100% failure rate)
7878 for i := 0 ; i < 10 ; i ++ {
79- cb .execute (ctx , failFunc )
79+ _ = cb .execute (ctx , failFunc )
8080 }
8181
8282 // Now circuit should be open
@@ -105,7 +105,7 @@ func TestCircuitBreaker_SlidingWindow(t *testing.T) {
105105
106106 // Fill window with 10 failures (100% failure rate)
107107 for i := 0 ; i < 10 ; i ++ {
108- cb .execute (ctx , failFunc )
108+ _ = cb .execute (ctx , failFunc )
109109 }
110110
111111 if cb .getState () != stateOpen {
@@ -116,22 +116,22 @@ func TestCircuitBreaker_SlidingWindow(t *testing.T) {
116116 time .Sleep (cfg .waitDurationInOpenState + 50 * time .Millisecond )
117117
118118 // Successful call to move to half-open
119- cb .execute (ctx , successFunc )
119+ _ = cb .execute (ctx , successFunc )
120120
121121 if cb .getState () != stateHalfOpen {
122122 t .Fatalf ("Expected state to be HalfOpen, got %v" , cb .getState ())
123123 }
124124
125125 // One more success should close it (2 successes needed)
126- cb .execute (ctx , successFunc )
126+ _ = cb .execute (ctx , successFunc )
127127
128128 if cb .getState () != stateClosed {
129129 t .Errorf ("Expected state to be Closed after half-open successes, got %v" , cb .getState ())
130130 }
131131
132132 // Window should be reset - now add 10 successes
133133 for i := 0 ; i < 10 ; i ++ {
134- cb .execute (ctx , successFunc )
134+ _ = cb .execute (ctx , successFunc )
135135 }
136136
137137 // Should remain closed (0% failure rate)
@@ -157,7 +157,7 @@ func TestCircuitBreaker_OpenRejectsRequests(t *testing.T) {
157157
158158 // Open the circuit (10 failures = 100% failure rate)
159159 for i := 0 ; i < 10 ; i ++ {
160- cb .execute (ctx , failFunc )
160+ _ = cb .execute (ctx , failFunc )
161161 }
162162
163163 if cb .getState () != stateOpen {
@@ -192,7 +192,7 @@ func TestCircuitBreaker_OpenToHalfOpen(t *testing.T) {
192192
193193 // Open the circuit
194194 for i := 0 ; i < 10 ; i ++ {
195- cb .execute (ctx , failFunc )
195+ _ = cb .execute (ctx , failFunc )
196196 }
197197
198198 if cb .getState () != stateOpen {
@@ -237,7 +237,7 @@ func TestCircuitBreaker_HalfOpenToClosed(t *testing.T) {
237237
238238 // Open the circuit
239239 for i := 0 ; i < 10 ; i ++ {
240- cb .execute (ctx , failFunc )
240+ _ = cb .execute (ctx , failFunc )
241241 }
242242
243243 // Wait for wait duration
@@ -274,7 +274,7 @@ func TestCircuitBreaker_HalfOpenToOpen(t *testing.T) {
274274
275275 // Open the circuit
276276 for i := 0 ; i < 10 ; i ++ {
277- cb .execute (ctx , failFunc )
277+ _ = cb .execute (ctx , failFunc )
278278 }
279279
280280 // Wait for wait duration
@@ -338,7 +338,7 @@ func TestCircuitBreaker_ConcurrentAccess(t *testing.T) {
338338 wg .Add (1 )
339339 go func () {
340340 defer wg .Done ()
341- cb .execute (ctx , func () error {
341+ _ = cb .execute (ctx , func () error {
342342 return errors .New ("test error" )
343343 })
344344 }()
@@ -441,11 +441,11 @@ func TestCircuitBreaker_FailureRateCalculation(t *testing.T) {
441441 // Execute 30 calls: 15 failures, 15 successes (50% failure rate)
442442 for i := 0 ; i < 30 ; i ++ {
443443 if i % 2 == 0 {
444- cb .execute (ctx , func () error {
444+ _ = cb .execute (ctx , func () error {
445445 return errors .New ("test error" )
446446 })
447447 } else {
448- cb .execute (ctx , func () error {
448+ _ = cb .execute (ctx , func () error {
449449 return nil
450450 })
451451 }
0 commit comments