From 9342b6df577910c6eac718dc62845d8c95f8548b Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Thu, 13 Jul 2023 20:08:34 +0200 Subject: [PATCH] Run tests with -parallel 1 in CI (#573) This is only a little bit slower, and reduces the chance that we run out of open file descriptors. --- .circleci/config.yml | 6 +++--- .cirrus.yml | 2 +- .github/workflows/test.yml | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index dac3af46..ed77df92 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -23,7 +23,7 @@ jobs: command: | uname -a go version - go test -race ./... + go test -parallel 1 -race ./... # iOS ios: @@ -48,7 +48,7 @@ jobs: export PATH=$PATH:/usr/local/Cellar/go/*/bin uname -a go version - go test -race ./... + go test -parallel 1 -race ./... # This is just Linux x86_64; also need to get a Go with GOOS=android, but # there aren't any pre-built versions of that on the Go site. Idk, disable for @@ -76,5 +76,5 @@ jobs: # uname -a # export PATH=/usr/local/go/bin:$PATH # go version - # go test -race ./... + # go test -parallel 1 -race ./... # diff --git a/.cirrus.yml b/.cirrus.yml index 89cd0225..d9a74da9 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -9,4 +9,4 @@ freebsd_task: # run tests as user "cirrus" instead of root - pw useradd cirrus -m - chown -R cirrus:cirrus . - - sudo -u cirrus go test -race ./... + - sudo -u cirrus go test -parallel 1 -race ./... diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aeb6b5f2..caa437c0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,7 @@ jobs: - name: test run: | - go test -race ./... + go test -parallel 1 -race ./... # Test gccgo testgcc: @@ -42,7 +42,7 @@ jobs: - name: test run: | sudo apt-get -y install gccgo-12 - go-12 test ./... + go-12 test -parallel 1 ./... # Test only the latest Go version on macOS; we use the macOS builders for BSD # and illumos, and GitHub doesn't allow many of them to run concurrently. If @@ -70,7 +70,7 @@ jobs: - name: test run: | - go test -race ./... + go test -parallel 1 -race ./... # OpenBSD; no -race as the VM doesn't include the comp set. # @@ -91,7 +91,7 @@ jobs: prepare: pkg_add go run: | useradd -mG wheel action - su action -c 'go test ./...' + su action -c 'go test -parallel 1 ./...' # NetBSD testNetBSD: @@ -107,7 +107,7 @@ jobs: # TODO: no -race for the same reason as OpenBSD (the timing; it does run). run: | useradd -mG wheel action - su action -c 'go120 test ./...' + su action -c 'go120 test -parallel 1 ./...' # illumos testillumos: @@ -125,7 +125,7 @@ jobs: useradd action export GOCACHE=/tmp/go-cache export GOPATH=/tmp/go-path - su action -c '/opt/ooce/go-1.19/bin/go test ./...' + su action -c '/opt/ooce/go-1.19/bin/go test -parallel 1 ./...' # Older Debian 6, for old Linux kernels. testDebian6: @@ -160,5 +160,5 @@ jobs: done vagrant up for t in *.test; do - vagrant ssh -c "/vagrant/$t" + vagrant ssh -c "/vagrant/$t -test.parallel 1" done