@@ -105,6 +105,33 @@ env:
105105 test_unpack
106106 test_weakref
107107 test_yield_from
108+ ENV_POLLUTING_TESTS_COMMON : >-
109+ test_raise
110+ test_ssl
111+ test_sys
112+ ENV_POLLUTING_TESTS_LINUX : >-
113+ test.test_multiprocessing_fork.test_processes
114+ test.test_multiprocessing_fork.test_threads
115+ test.test_multiprocessing_forkserver.test_processes
116+ test.test_multiprocessing_forkserver.test_threads
117+ test.test_multiprocessing_spawn.test_processes
118+ test.test_multiprocessing_spawn.test_threads
119+ test_file_eintr
120+ test_subprocess
121+ ENV_POLLUTING_TESTS_MACOS : >-
122+ test_multiprocessing_forkserver.test_manager
123+ test.test_multiprocessing_forkserver.test_misc
124+ test.test_multiprocessing_forkserver.test_processes
125+ test.test_multiprocessing_forkserver.test_threads
126+ test.test_multiprocessing_spawn.test_manager
127+ test.test_multiprocessing_spawn.test_misc
128+ test.test_multiprocessing_spawn.test_processes
129+ test.test_multiprocessing_spawn.test_threads
130+ test_ftplib
131+ test_logging
132+ test_multiprocessing_main_handling
133+ test_subprocess
134+ ENV_POLLUTING_TESTS_WINDOWS : >-
108135 # Python version targeted by the CI.
109136 PYTHON_VERSION : " 3.13.1"
110137 X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR : C:\Program Files\OpenSSL\lib\VC\x64\MD
@@ -278,26 +305,81 @@ jobs:
278305
279306 - if : runner.os == 'Linux'
280307 name : run cpython platform-independent tests
308+ env :
309+ RUSTPYTHON_SKIP_ENV_POLLUTERS : true
281310 run :
282311 target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v ${{ env.PLATFORM_INDEPENDENT_TESTS }}
283312 timeout-minutes : 35
284313
285314 - if : runner.os == 'Linux'
286315 name : run cpython platform-dependent tests (Linux)
316+ env :
317+ RUSTPYTHON_SKIP_ENV_POLLUTERS : true
287318 run : target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }}
288319 timeout-minutes : 35
289320
290321 - if : runner.os == 'macOS'
291322 name : run cpython platform-dependent tests (MacOS)
323+ env :
324+ RUSTPYTHON_SKIP_ENV_POLLUTERS : true
292325 run : target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }}
293326 timeout-minutes : 35
294327
295328 - if : runner.os == 'Windows'
296329 name : run cpython platform-dependent tests (windows partial - fixme)
330+ env :
331+ RUSTPYTHON_SKIP_ENV_POLLUTERS : true
297332 run :
298333 target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.WINDOWS_SKIPS }}
299334 timeout-minutes : 45
300335
336+ - if : runner.os == 'Linux'
337+ name : run cpython tests to check if env polluters have stopped polluting (Common/Linux)
338+ shell : bash
339+ run : |
340+ for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_LINUX }}; do
341+ set +e
342+ target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing}
343+ exit_code=$?
344+ set -e
345+ if [ ${exit_code} -ne 3 ]; then
346+ echo "Test ${thing} is no longer polluting the environment!"
347+ exit 1
348+ fi
349+ done
350+ timeout-minutes : 15
351+
352+ - if : runner.os == 'macOS'
353+ name : run cpython tests to check if env polluters have stopped polluting (Common/macOS)
354+ run : |
355+ for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_MACOS }}; do
356+ set +e
357+ target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing}
358+ exit_code=$?
359+ set -e
360+ if [ ${exit_code} -ne 3 ]; then
361+ echo "Test ${thing} is no longer polluting the environment!"
362+ exit 1
363+ fi
364+ done
365+ timeout-minutes : 15
366+
367+ - if : runner.os == 'Windows'
368+ name : run cpython tests to check if env polluters have stopped polluting (Common/windows)
369+ shell : bash
370+ run : |
371+ for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_WINDOWS }}; do
372+ set +e
373+ target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing}
374+ exit_code=$?
375+ set -e
376+ if [ ${exit_code} -ne 3 ]; then
377+ echo "Test ${thing} is no longer polluting the environment!"
378+ exit 1
379+ fi
380+ done
381+ timeout-minutes : 15
382+
301383 - if : runner.os != 'Windows'
302384 name : check that --install-pip succeeds
303385 run : |
0 commit comments