(t *testing.T, fs *FS)
| 480 | } |
| 481 | |
| 482 | func 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 | |
| 508 | func TestFSByteRangeSingleThread(t *testing.T) { |
| 509 | // This test can't run parallel as files in / might be changed by other tests. |
no test coverage detected
searching dependent graphs…