(t *testing.T)
| 26 | } |
| 27 | |
| 28 | func TestOpenFilePool_Concurrent(t *testing.T) { |
| 29 | var pool = caches.NewOpenFilePool("a") |
| 30 | var concurrent = 1000 |
| 31 | var wg = &sync.WaitGroup{} |
| 32 | wg.Add(concurrent) |
| 33 | for i := 0; i < concurrent; i++ { |
| 34 | go func() { |
| 35 | defer wg.Done() |
| 36 | |
| 37 | if rands.Int(0, 1) == 1 { |
| 38 | pool.Put(caches.NewOpenFile(nil, nil, nil, 0, 1)) |
| 39 | } |
| 40 | if rands.Int(0, 1) == 0 { |
| 41 | pool.Get() |
| 42 | } |
| 43 | }() |
| 44 | } |
| 45 | wg.Wait() |
| 46 | } |
nothing calls this directly
no test coverage detected