(t *testing.T)
| 44 | } |
| 45 | |
| 46 | func testBatchQueuePutWakesSleepingGetter(t *testing.T) { |
| 47 | bq := newBatchQueue(10) |
| 48 | var wg sync.WaitGroup |
| 49 | ready := make(chan struct{}) |
| 50 | var batch *writeBatch |
| 51 | wg.Add(1) |
| 52 | go func() { |
| 53 | defer wg.Done() |
| 54 | close(ready) |
| 55 | batch = bq.Get() |
| 56 | }() |
| 57 | <-ready |
| 58 | bq.Put(newWriteBatch(time.Now(), time.Hour*100)) |
| 59 | wg.Wait() |
| 60 | if batch == nil { |
| 61 | t.Fatal("got nil batch") |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | func testBatchQueuePutAfterCloseFails(t *testing.T) { |
| 66 | bq := newBatchQueue(10) |
nothing calls this directly
no test coverage detected