From 016b71680ad8e2824cf4a98a84bf3d6a60a833cc Mon Sep 17 00:00:00 2001 From: Anmol Sethi <hi@nhooyr.io> Date: Sun, 1 Sep 2019 00:02:37 -0500 Subject: [PATCH] Improve test speed --- ci/test.sh | 1 + websocket_test.go | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ci/test.sh b/ci/test.sh index c8b8ec1..7b61192 100755 --- a/ci/test.sh +++ b/ci/test.sh @@ -19,6 +19,7 @@ fi # We always want coverage and race detection. argv+=( + "-parallel=512" "-coverprofile=ci/out/coverage.prof" "-coverpkg=./..." ) diff --git a/websocket_test.go b/websocket_test.go index 3482cbd..27750bc 100644 --- a/websocket_test.go +++ b/websocket_test.go @@ -1768,8 +1768,8 @@ func TestAutobahn(t *testing.T) { t.Parallel() lengths := []int{ - 1 << 16, // 65536 - 1 << 18, // 262144 + 1 << 16, + 1 << 18, // Anything higher is completely unnecessary. } @@ -1791,7 +1791,6 @@ func TestAutobahn(t *testing.T) { 1 << 12, 1 << 14, 1 << 16, - 1 << 18, } for _, l := range fragments { @@ -1801,7 +1800,7 @@ func TestAutobahn(t *testing.T) { if err != nil { return err } - b := randBytes(1 << 18) + b := randBytes(1 << 16) for i := 0; i < len(b); { j := i + fragmentLength if j > len(b) { @@ -1835,7 +1834,6 @@ func TestAutobahn(t *testing.T) { lengths := []int{ 0, 16, - 64, } for _, l := range lengths { -- GitLab