MCPcopy Create free account
hub / github.com/valyala/bytebufferpool / TestByteBufferGetPutConcurrent

Function TestByteBufferGetPutConcurrent

bytebuffer_test.go:73–90  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

71}
72
73func TestByteBufferGetPutConcurrent(t *testing.T) {
74 concurrency := 10
75 ch := make(chan struct{}, concurrency)
76 for i := 0; i < concurrency; i++ {
77 go func() {
78 testByteBufferGetPut(t)
79 ch <- struct{}{}
80 }()
81 }
82
83 for i := 0; i < concurrency; i++ {
84 select {
85 case <-ch:
86 case <-time.After(time.Second):
87 t.Fatalf("timeout!")
88 }
89 }
90}
91
92func testByteBufferGetPut(t *testing.T) {
93 for i := 0; i < 10; i++ {

Callers

nothing calls this directly

Calls 1

testByteBufferGetPutFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…