diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6b641b8a3..4cb2528a0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -337,12 +337,18 @@ jobs: shell: bash run: | for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_LINUX }}; do - set +e - target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing} - exit_code=$? - set -e + for i in $(seq 1 10); do + set +e + target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing} + exit_code=$? + set -e + if [ ${exit_code} -eq 3 ]; then + echo "Test ${thing} polluted the environment on attempt ${i}." + break + fi + done if [ ${exit_code} -ne 3 ]; then - echo "Test ${thing} is no longer polluting the environment!" + echo "Test ${thing} is no longer polluting the environment after ${i} attempts!" exit 1 fi done @@ -352,12 +358,18 @@ jobs: name: run cpython tests to check if env polluters have stopped polluting (Common/macOS) run: | for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_MACOS }}; do - set +e - target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing} - exit_code=$? - set -e + for i in $(seq 1 10); do + set +e + target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing} + exit_code=$? + set -e + if [ ${exit_code} -eq 3 ]; then + echo "Test ${thing} polluted the environment on attempt ${i}." + break + fi + done if [ ${exit_code} -ne 3 ]; then - echo "Test ${thing} is no longer polluting the environment!" + echo "Test ${thing} is no longer polluting the environment after ${i} attempts!" exit 1 fi done @@ -368,12 +380,18 @@ jobs: shell: bash run: | for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_WINDOWS }}; do - set +e - target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing} - exit_code=$? - set -e + for i in $(seq 1 10); do + set +e + target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing} + exit_code=$? + set -e + if [ ${exit_code} -eq 3 ]; then + echo "Test ${thing} polluted the environment on attempt ${i}." + break + fi + done if [ ${exit_code} -ne 3 ]; then - echo "Test ${thing} is no longer polluting the environment!" + echo "Test ${thing} is no longer polluting the environment after ${i} attempts!" exit 1 fi done