(t *testing.T)
| 224 | } |
| 225 | |
| 226 | func TestRecordRPCCost(t *testing.T) { |
| 227 | Convey("Bug: bad critical section for multiple values", t, func(c C) { |
| 228 | var ( |
| 229 | start = time.Now() |
| 230 | rounds = 1000 |
| 231 | concurrent = 10 |
| 232 | wg = &sync.WaitGroup{} |
| 233 | body = func(i int) { |
| 234 | defer func() { |
| 235 | c.So(recover(), ShouldBeNil) |
| 236 | wg.Done() |
| 237 | }() |
| 238 | recordRPCCost(start, fmt.Sprintf("M%d", i), nil) |
| 239 | } |
| 240 | ) |
| 241 | for i := 0; i < rounds; i++ { |
| 242 | for j := 0; j < concurrent; j++ { |
| 243 | wg.Add(1) |
| 244 | go body(i) |
| 245 | } |
| 246 | wg.Wait() |
| 247 | } |
| 248 | }) |
| 249 | } |
nothing calls this directly
no test coverage detected