(t *testing.T)
| 169 | } |
| 170 | |
| 171 | func TestBreakerNoOverload(t *testing.T) { |
| 172 | params := BreakerParams{QueueDepth: 1, MaxConcurrency: 1, InitialCapacity: 1} |
| 173 | b := NewBreaker(params) // Breaker capacity = 2 |
| 174 | reqs := newRequestor(b) |
| 175 | |
| 176 | // Bring request to capacity. |
| 177 | reqs.request() |
| 178 | reqs.request() |
| 179 | |
| 180 | // Process one, send a new one in, at capacity again. |
| 181 | reqs.processSuccessfully(t) |
| 182 | reqs.request() |
| 183 | |
| 184 | // Process one, send a new one in, at capacity again. |
| 185 | reqs.processSuccessfully(t) |
| 186 | reqs.request() |
| 187 | |
| 188 | // Process the remainder successfully. |
| 189 | reqs.processSuccessfully(t) |
| 190 | reqs.processSuccessfully(t) |
| 191 | } |
| 192 | |
| 193 | func TestBreakerCancel(t *testing.T) { |
| 194 | params := BreakerParams{QueueDepth: 1, MaxConcurrency: 1, InitialCapacity: 0} |
nothing calls this directly
no test coverage detected