Mask acceptance test flakiness with retries (#387)

This commit is contained in:
Joshua Spence
2023-06-30 11:37:37 +10:00
committed by GitHub
parent 9203ef8ed1
commit 595e4d1873
2 changed files with 12 additions and 6 deletions

View File

@@ -33,6 +33,11 @@ jobs:
go-version-file: "go.mod"
check-latest: true
# The acceptance tests sometimes timeout for some unknown reason.
- name: TF acceptance tests
timeout-minutes: 20
run: make testacc UNIFI_STDOUT=true UNIFI_VERSION=${{ matrix.unifi_download_url && 'beta' || matrix.unifi_version }} UNIFI_DOWNLOAD_URL=${{ matrix.unifi_download_url }}
uses: "nick-fields/retry@v2"
with:
timeout_minutes: 20
max_attempts: 3
command: make testacc TEST_TIMEOUT=1h UNIFI_STDOUT=true UNIFI_VERSION=${{ matrix.unifi_download_url && 'beta' || matrix.unifi_version }} UNIFI_DOWNLOAD_URL=${{ matrix.unifi_download_url }}
retry_on: "timeout"

View File

@@ -1,6 +1,7 @@
TEST ?= ./...
TESTARGS ?=
TEST_COUNT ?= 1
TEST ?= ./...
TESTARGS ?=
TEST_COUNT ?= 1
TEST_TIMEOUT ?= 10m
.PHONY: default
default: build
@@ -11,4 +12,4 @@ build:
.PHONY: testacc
testacc:
TF_ACC=1 go test $(TEST) -v -count=$(TEST_COUNT) $(TESTARGS)
TF_ACC=1 go test $(TEST) -v -count $(TEST_COUNT) -timeout $(TEST_TIMEOUT) $(TESTARGS)