Skip to content

Commit

Permalink
Add retry to tests
Browse files Browse the repository at this point in the history
Signed-off-by: Charlie Le <[email protected]>
  • Loading branch information
CharlieTLe committed May 22, 2024
1 parent cb4633e commit 27d61a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
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

0 comments on commit 27d61a1

Please sign in to comment.