Skip to content

Commit

Permalink
Run tests without -race on Windows to minimize flakiness
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Mirić committed Oct 12, 2020
1 parent 950fd35 commit cd6c20d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,17 @@ jobs:
go-version: ${{ matrix.go-version }}
- name: Run tests
run: |
set -x
go version
export GOMAXPROCS=2
go test -p 2 -race -timeout 800s ./...
args=("-p" "2" "-race")
# Run with less concurrency on Windows to minimize flakiness.
if [[ "${{ matrix.platform }}" == windows* ]]; then
unset args[2]
args[1]="1"
export GOMAXPROCS=1
fi
go test "${args[@]}" -timeout 800s ./...
test-cov:
strategy:
Expand All @@ -98,14 +106,21 @@ jobs:
run: |
go version
export GOMAXPROCS=2
args=("-p" "2" "-race")
# Run with less concurrency on Windows to minimize flakiness.
if [[ "${{ matrix.platform }}" == windows* ]]; then
unset args[2]
args[1]="1"
export GOMAXPROCS=1
fi
echo "mode: set" > coverage.txt
for pkg in $(go list ./... | grep -v vendor); do
list=$(go list -test -f '{{ join .Deps "\n"}}' $pkg | grep github.com/loadimpact/k6 | grep -v vendor || true)
if [ -n "$list" ]; then
list=$(echo "$list" | cut -f1 -d ' ' | sort -u | paste -sd, -)
fi
go test -race -timeout 800s --coverpkg="$list" -coverprofile=$(echo $pkg | tr / -).coverage $pkg
go test "${args[@]}" -timeout 800s --coverpkg="$list" -coverprofile=$(echo $pkg | tr / -).coverage $pkg
done
grep -h -v "^mode:" *.coverage >> coverage.txt
rm -f *.coverage
Expand Down

0 comments on commit cd6c20d

Please sign in to comment.