(t *testing.T)
| 230 | } |
| 231 | |
| 232 | func TestBreakerUpdateConcurrency(t *testing.T) { |
| 233 | params := BreakerParams{QueueDepth: 1, MaxConcurrency: 1, InitialCapacity: 0} |
| 234 | b := NewBreaker(params) |
| 235 | b.UpdateConcurrency(1) |
| 236 | if got, want := b.Capacity(), 1; got != want { |
| 237 | t.Errorf("Capacity() = %d, want: %d", got, want) |
| 238 | } |
| 239 | |
| 240 | b.UpdateConcurrency(0) |
| 241 | if got, want := b.Capacity(), 0; got != want { |
| 242 | t.Errorf("Capacity() = %d, want: %d", got, want) |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | // Test empty semaphore, token cannot be acquired |
| 247 | func TestSemaphoreAcquireHasNoCapacity(t *testing.T) { |
nothing calls this directly
no test coverage detected