(t *testing.T)
| 136 | } |
| 137 | |
| 138 | func TestBreakerQueueing(t *testing.T) { |
| 139 | params := BreakerParams{QueueDepth: 2, MaxConcurrency: 1, InitialCapacity: 0} |
| 140 | b := NewBreaker(params) // Breaker capacity = 2 |
| 141 | reqs := newRequestor(b) |
| 142 | |
| 143 | // Bring breaker to capacity. Doesn't error because queue subsumes these requests. |
| 144 | reqs.request() |
| 145 | reqs.request() |
| 146 | |
| 147 | // Update concurrency to allow the requests to be processed. |
| 148 | b.UpdateConcurrency(1) |
| 149 | |
| 150 | // They should pass just fine. |
| 151 | reqs.processSuccessfully(t) |
| 152 | reqs.processSuccessfully(t) |
| 153 | } |
| 154 | |
| 155 | func TestBreakerInflight(t *testing.T) { |
| 156 | params := BreakerParams{QueueDepth: 2, MaxConcurrency: 1, InitialCapacity: 1} |
nothing calls this directly
no test coverage detected