From 4c86219afaad41e615759533707e54bf484215aa Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Thu, 1 Aug 2024 14:17:19 +0200 Subject: [PATCH] Retry mosquitto tests as they appear to be flaky --- .github/workflows/mosquitto.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mosquitto.yml b/.github/workflows/mosquitto.yml index a960dafbc1..bedd1e4195 100644 --- a/.github/workflows/mosquitto.yml +++ b/.github/workflows/mosquitto.yml @@ -80,4 +80,14 @@ jobs: - name: Run mosquitto tests working-directory: ./mosquitto run: | - make WITH_TLS=wolfssl WITH_CJSON=no WITH_DOCS=no WOLFSSLDIR=$GITHUB_WORKSPACE/build-dir ptest \ No newline at end of file + # Retry up to five times + for i in {1..5}; do + TEST_RES=0 + make WITH_TLS=wolfssl WITH_CJSON=no WITH_DOCS=no WOLFSSLDIR=$GITHUB_WORKSPACE/build-dir ptest || TEST_RES=$? + if [ "$TEST_RES" -eq "0" ]; then + break + fi + done + if [ "$TEST_RES" -ne "0" ]; then + exit $TEST_RES + fi