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

Function TestFSFSByteRangeConcurrent

fs_fs_test.go:309–342  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

307}
308
309func TestFSFSByteRangeConcurrent(t *testing.T) {
310 t.Parallel()
311
312 stop := make(chan struct{})
313 defer close(stop)
314
315 fs := &FS{
316 FS: fsTestFilesystem,
317 Root: "",
318 AcceptByteRange: true,
319 CleanStop: stop,
320 }
321 h := fs.NewRequestHandler()
322
323 concurrency := 10
324 ch := make(chan struct{}, concurrency)
325 for range concurrency {
326 go func() {
327 for range 5 {
328 testFSByteRange(t, h, "/fs.go")
329 testFSByteRange(t, h, "/README.md")
330 }
331 ch <- struct{}{}
332 }()
333 }
334
335 for range concurrency {
336 select {
337 case <-time.After(time.Second):
338 t.Fatalf("timeout")
339 case <-ch:
340 }
341 }
342}
343
344func TestFSFSByteRangeSingleThread(t *testing.T) {
345 t.Parallel()

Callers

nothing calls this directly

Calls 2

NewRequestHandlerMethod · 0.95
testFSByteRangeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…