diff --git a/fs_test.go b/fs_test.go index 5c39cb190f..51a7e2ab3c 100644 --- a/fs_test.go +++ b/fs_test.go @@ -483,6 +483,11 @@ func testParseByteRangeError(t *testing.T, v string, contentLength int) { } func TestFSCompressConcurrent(t *testing.T) { + // Don't run this test on Windows, the Windows Github actions are to slow and timeout too often. + if runtime.GOOS == "windows" { + t.SkipNow() + } + // This test can't run parallel as files in / might be changed by other tests. stop := make(chan struct{}) @@ -513,7 +518,7 @@ func TestFSCompressConcurrent(t *testing.T) { for i := 0; i < concurrency; i++ { select { case <-ch: - case <-time.After(time.Second * 3): + case <-time.After(time.Second * 2): t.Fatalf("timeout") } } @@ -540,6 +545,11 @@ func TestFSCompressSingleThread(t *testing.T) { } func testFSCompress(t *testing.T, h RequestHandler, filePath string) { + // File locking is flaky on Windows. + if runtime.GOOS == "windows" { + t.SkipNow() + } + var ctx RequestCtx ctx.Init(&Request{}, nil, nil) diff --git a/header.go b/header.go index 14cda98808..123fe95f9b 100644 --- a/header.go +++ b/header.go @@ -1991,7 +1991,7 @@ func (h *RequestHeader) tryRead(r *bufio.Reader, n int) error { // This is for go 1.6 bug. See https://github.com/golang/go/issues/14121 . if err == bufio.ErrBufferFull { return &ErrSmallBuffer{ - error: fmt.Errorf("error when reading request headers: %w", errSmallBuffer), + error: fmt.Errorf("error when reading request headers: %w (n=%d, r.Buffered()=%d)", errSmallBuffer, n, r.Buffered()), } } diff --git a/server_test.go b/server_test.go index 0a199b8e28..ec2f656e0c 100644 --- a/server_test.go +++ b/server_test.go @@ -1142,7 +1142,7 @@ func TestServerTLSReadTimeout(t *testing.T) { select { case err = <-r: - case <-time.After(time.Second): + case <-time.After(time.Second * 2): } if err == nil {