MCPcopy
hub / github.com/cortexlabs/cortex / TestSemaphoreAcquireNonBlockingHasNoCapacity

Function TestSemaphoreAcquireNonBlockingHasNoCapacity

pkg/proxy/breaker_test.go:261–266  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

259}
260
261func TestSemaphoreAcquireNonBlockingHasNoCapacity(t *testing.T) {
262 sem := newSemaphore(1, 0)
263 if sem.tryAcquire() {
264 t.Error("Should have failed immediately")
265 }
266}
267
268// Test empty semaphore, add capacity, token can be acquired
269func TestSemaphoreAcquireHasCapacity(t *testing.T) {

Callers

nothing calls this directly

Calls 3

newSemaphoreFunction · 0.85
tryAcquireMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected