MCPcopy
hub / github.com/valyala/fasthttp / runFSByteRangeConcurrent

Function runFSByteRangeConcurrent

fs_test.go:482–506  ·  view source on GitHub ↗
(t *testing.T, fs *FS)

Source from the content-addressed store, hash-verified

480}
481
482func runFSByteRangeConcurrent(t *testing.T, fs *FS) {
483 t.Helper()
484
485 h := fs.NewRequestHandler()
486
487 concurrency := 10
488 ch := make(chan struct{}, concurrency)
489 for range concurrency {
490 go func() {
491 for range 5 {
492 testFSByteRange(t, h, "/fs.go")
493 testFSByteRange(t, h, "/README.md")
494 }
495 ch <- struct{}{}
496 }()
497 }
498
499 for range concurrency {
500 select {
501 case <-time.After(time.Second):
502 t.Fatalf("timeout")
503 case <-ch:
504 }
505 }
506}
507
508func TestFSByteRangeSingleThread(t *testing.T) {
509 // This test can't run parallel as files in / might be changed by other tests.

Callers 2

Calls 2

testFSByteRangeFunction · 0.85
NewRequestHandlerMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…