(t *testing.T)
| 13 | ) |
| 14 | |
| 15 | func TestLimiter_SetThreads(t *testing.T) { |
| 16 | var limiter = fsutils.NewLimiter(4) |
| 17 | |
| 18 | var concurrent = 1024 |
| 19 | |
| 20 | var wg = sync.WaitGroup{} |
| 21 | wg.Add(concurrent) |
| 22 | |
| 23 | for i := 0; i < concurrent; i++ { |
| 24 | go func() { |
| 25 | defer wg.Done() |
| 26 | |
| 27 | limiter.SetThreads(rand.Int() % 128) |
| 28 | limiter.TryAck() |
| 29 | }() |
| 30 | } |
| 31 | |
| 32 | wg.Wait() |
| 33 | } |
| 34 | |
| 35 | func TestLimiter_Ack(t *testing.T) { |
| 36 | var a = assert.NewAssertion(t) |
nothing calls this directly
no test coverage detected