(t *testing.T)
| 101 | } |
| 102 | |
| 103 | func TestConcurrency(t *testing.T) { |
| 104 | if testing.Short() { |
| 105 | t.Logf("skipping for short mode") |
| 106 | return |
| 107 | } |
| 108 | s, clean := newSorted(t) |
| 109 | defer clean() |
| 110 | const n = 100 |
| 111 | ch := make(chan error) |
| 112 | for i := 0; i < n; i++ { |
| 113 | i := i |
| 114 | go func() { |
| 115 | bm := s.BeginBatch() |
| 116 | bm.Set("keyA-"+fmt.Sprint(i), fmt.Sprintf("valA=%d", i)) |
| 117 | bm.Set("keyB-"+fmt.Sprint(i), fmt.Sprintf("valB=%d", i)) |
| 118 | ch <- s.CommitBatch(bm) |
| 119 | }() |
| 120 | } |
| 121 | for i := 0; i < n; i++ { |
| 122 | if err := <-ch; err != nil { |
| 123 | t.Errorf("%d: %v", i, err) |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | func numFDs(t *testing.T) int { |
| 129 | lsofPath, err := exec.LookPath("lsof") |
nothing calls this directly
no test coverage detected