Check 10 times if a test is still polluting the environment

This commit is contained in:
Padraic Fanning committed 2026-01-10 22:10:35 -05:00
1 parent 3427215611
commit 0d128ccc28
1 file changed
+33 -15
+33 -15
View File
@@ -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