MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / TestRecordRPCCost

Function TestRecordRPCCost

rpc/pool_test.go:226–249  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

224}
225
226func 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}

Callers

nothing calls this directly

Calls 3

recordRPCCostFunction · 0.85
WaitMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected