diff options
author | Erik Dubbelboer <erik@dubbelboer.com> | 2021-08-28 09:42:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-28 09:42:38 +0200 |
commit | 51508d748079b2518c18c8259aace29f15f5ebea (patch) | |
tree | ab5f257f87c5c31d81ebe79d349b16132f5fb5bb /fs_test.go | |
parent | Fix s2b (#1079) (diff) | |
download | fasthttp-51508d748079b2518c18c8259aace29f15f5ebea.tar.gz fasthttp-51508d748079b2518c18c8259aace29f15f5ebea.tar.bz2 fasthttp-51508d748079b2518c18c8259aace29f15f5ebea.zip |
Fix various Windows Github Action errors (#1082)
* Fix various Windows Github Action errors
These tests keep giving errors because Windows Actions are slower.
* Remove some timeouts
We don't need timeouts in all tests, only in the ones where we are
actually testing timeout logic.
Diffstat (limited to 'fs_test.go')
-rw-r--r-- | fs_test.go | 28 |
1 files changed, 14 insertions, 14 deletions
@@ -480,7 +480,7 @@ func testParseByteRangeError(t *testing.T, v string, contentLength int) { } func TestFSCompressConcurrent(t *testing.T) { - // This test can't run parallel as files in / might by changed by other tests. + // This test can't run parallel as files in / might be changed by other tests. stop := make(chan struct{}) defer close(stop) @@ -549,14 +549,14 @@ func testFSCompress(t *testing.T, h RequestHandler, filePath string) { s := ctx.Response.String() br := bufio.NewReader(bytes.NewBufferString(s)) if err := resp.Read(br); err != nil { - t.Fatalf("unexpected error: %s. filePath=%q", err, filePath) + t.Errorf("unexpected error: %s. filePath=%q", err, filePath) } if resp.StatusCode() != StatusOK { - t.Fatalf("unexpected status code: %d. Expecting %d. filePath=%q", resp.StatusCode(), StatusOK, filePath) + t.Errorf("unexpected status code: %d. Expecting %d. filePath=%q", resp.StatusCode(), StatusOK, filePath) } ce := resp.Header.Peek(HeaderContentEncoding) if string(ce) != "" { - t.Fatalf("unexpected content-encoding %q. Expecting empty string. filePath=%q", ce, filePath) + t.Errorf("unexpected content-encoding %q. Expecting empty string. filePath=%q", ce, filePath) } body := string(resp.Body()) @@ -568,21 +568,21 @@ func testFSCompress(t *testing.T, h RequestHandler, filePath string) { s = ctx.Response.String() br = bufio.NewReader(bytes.NewBufferString(s)) if err := resp.Read(br); err != nil { - t.Fatalf("unexpected error: %s. filePath=%q", err, filePath) + t.Errorf("unexpected error: %s. filePath=%q", err, filePath) } if resp.StatusCode() != StatusOK { - t.Fatalf("unexpected status code: %d. Expecting %d. filePath=%q", resp.StatusCode(), StatusOK, filePath) + t.Errorf("unexpected status code: %d. Expecting %d. filePath=%q", resp.StatusCode(), StatusOK, filePath) } ce = resp.Header.Peek(HeaderContentEncoding) if string(ce) != "gzip" { - t.Fatalf("unexpected content-encoding %q. Expecting %q. filePath=%q", ce, "gzip", filePath) + t.Errorf("unexpected content-encoding %q. Expecting %q. filePath=%q", ce, "gzip", filePath) } zbody, err := resp.BodyGunzip() if err != nil { - t.Fatalf("unexpected error when gunzipping response body: %s. filePath=%q", err, filePath) + t.Errorf("unexpected error when gunzipping response body: %s. filePath=%q", err, filePath) } if string(zbody) != body { - t.Fatalf("unexpected body len=%d. Expected len=%d. FilePath=%q", len(zbody), len(body), filePath) + t.Errorf("unexpected body len=%d. Expected len=%d. FilePath=%q", len(zbody), len(body), filePath) } // request compressed brotli file @@ -593,21 +593,21 @@ func testFSCompress(t *testing.T, h RequestHandler, filePath string) { s = ctx.Response.String() br = bufio.NewReader(bytes.NewBufferString(s)) if err = resp.Read(br); err != nil { - t.Fatalf("unexpected error: %s. filePath=%q", err, filePath) + t.Errorf("unexpected error: %s. filePath=%q", err, filePath) } if resp.StatusCode() != StatusOK { - t.Fatalf("unexpected status code: %d. Expecting %d. filePath=%q", resp.StatusCode(), StatusOK, filePath) + t.Errorf("unexpected status code: %d. Expecting %d. filePath=%q", resp.StatusCode(), StatusOK, filePath) } ce = resp.Header.Peek(HeaderContentEncoding) if string(ce) != "br" { - t.Fatalf("unexpected content-encoding %q. Expecting %q. filePath=%q", ce, "br", filePath) + t.Errorf("unexpected content-encoding %q. Expecting %q. filePath=%q", ce, "br", filePath) } zbody, err = resp.BodyUnbrotli() if err != nil { - t.Fatalf("unexpected error when unbrotling response body: %s. filePath=%q", err, filePath) + t.Errorf("unexpected error when unbrotling response body: %s. filePath=%q", err, filePath) } if string(zbody) != body { - t.Fatalf("unexpected body len=%d. Expected len=%d. FilePath=%q", len(zbody), len(body), filePath) + t.Errorf("unexpected body len=%d. Expected len=%d. FilePath=%q", len(zbody), len(body), filePath) } } |