Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retry to tests #5968

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/test-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ jobs:
mkdir -p /go/src/github.com/cortexproject/cortex
ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/cortex
- name: Run Tests
run: make BUILD_IN_CONTAINER=false test
run: |
for run in $(seq 1 3); do
make BUILD_IN_CONTAINER=false test && break
echo "Retrying tests... Run $run failed."
done

security:
name: CodeQL
Expand Down Expand Up @@ -193,7 +197,10 @@ jobs:
export CORTEX_IMAGE="${CORTEX_IMAGE_PREFIX}cortex:$IMAGE_TAG-amd64"
export CORTEX_CHECKOUT_DIR="/go/src/github.com/cortexproject/cortex"
echo "Running integration tests with image: $CORTEX_IMAGE"
go test -tags=integration,${{ matrix.tags }} -timeout 2400s -v -count=1 ./integration/...
for run in $(seq 1 3); do
go test -tags=integration,${{ matrix.tags }} -timeout 2400s -v -count=1 -failfast ./integration/... && break
echo "Retrying tests... Run $run failed."
done
env:
IMAGE_PREFIX: ${{ secrets.IMAGE_PREFIX }}

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ lint:
./pkg/ruler/...

test:
go test -tags netgo -timeout 30m -race -count 1 ./...
go test -tags netgo -timeout 30m -race -failfast -count 1 ./...

cover:
$(eval COVERDIR := $(shell mktemp -d coverage.XXXXXXXXXX))
Expand Down
Loading