@@ -112,7 +112,7 @@ func TestPathNotFoundFunc(t *testing.T) {
112
112
}
113
113
114
114
func TestServeFileHead (t * testing.T ) {
115
- t . Parallel ()
115
+ // This test can't run parallel as files in / might by changed by other tests.
116
116
117
117
var ctx RequestCtx
118
118
var req Request
@@ -204,7 +204,7 @@ func (pw pureWriter) Write(p []byte) (nn int, err error) {
204
204
}
205
205
206
206
func TestServeFileCompressed (t * testing.T ) {
207
- t . Parallel ()
207
+ // This test can't run parallel as files in / might by changed by other tests.
208
208
209
209
var ctx RequestCtx
210
210
ctx .Init (& Request {}, nil , nil )
@@ -270,7 +270,7 @@ func TestServeFileCompressed(t *testing.T) {
270
270
}
271
271
272
272
func TestServeFileUncompressed (t * testing.T ) {
273
- t . Parallel ()
273
+ // This test can't run parallel as files in / might by changed by other tests.
274
274
275
275
var ctx RequestCtx
276
276
var req Request
@@ -611,25 +611,9 @@ func testFSCompress(t *testing.T, h RequestHandler, filePath string) {
611
611
}
612
612
}
613
613
614
- func TestFileLock (t * testing.T ) {
615
- t .Parallel ()
616
-
617
- for i := 0 ; i < 10 ; i ++ {
618
- filePath := fmt .Sprintf ("foo/bar/%d.jpg" , i )
619
- lock := getFileLock (filePath )
620
- lock .Lock ()
621
- lock .Unlock () // nolint:staticcheck
622
- }
623
-
624
- for i := 0 ; i < 10 ; i ++ {
625
- filePath := fmt .Sprintf ("foo/bar/%d.jpg" , i )
626
- lock := getFileLock (filePath )
627
- lock .Lock ()
628
- lock .Unlock () // nolint:staticcheck
629
- }
630
- }
631
-
632
614
func TestFSHandlerSingleThread (t * testing.T ) {
615
+ // This test can't run parallel as files in / might by changed by other tests.
616
+
633
617
requestHandler := FSHandler ("." , 0 )
634
618
635
619
f , err := os .Open ("." )
@@ -650,6 +634,8 @@ func TestFSHandlerSingleThread(t *testing.T) {
650
634
}
651
635
652
636
func TestFSHandlerConcurrent (t * testing.T ) {
637
+ // This test can't run parallel as files in / might by changed by other tests.
638
+
653
639
requestHandler := FSHandler ("." , 0 )
654
640
655
641
f , err := os .Open ("." )
@@ -796,7 +782,7 @@ func testFileExtension(t *testing.T, path string, compressed bool, compressedFil
796
782
}
797
783
798
784
func TestServeFileContentType (t * testing.T ) {
799
- t . Parallel ()
785
+ // This test can't run parallel as files in / might by changed by other tests.
800
786
801
787
var ctx RequestCtx
802
788
var req Request
0 commit comments