From 54420c4471cd7f8205d5680283a7889e71d16af3 Mon Sep 17 00:00:00 2001 From: "Jeong, YunWon" <69878+youknowone@users.noreply.github.com> Date: Mon, 21 Sep 2026 12:19:14 +0900 Subject: [PATCH] Drop serial MP CI retries and killpg overlay (#8756) Multiprocessing fork/spawn/forkserver now run in the main -j $CORES CPython test job. Remove expectedFailureIf for os.killpg now that killpg exists. Assisted-by: Grok:4.6 --- .github/workflows/ci.yaml | 36 +--------------------------- Lib/test/_test_multiprocessing.py | 1 - crates/stdlib/src/multiprocessing.rs | 3 +-- 3 files changed, 2 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 5742c88ec..1f602984d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -454,11 +454,6 @@ jobs: if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }} env: RUST_BACKTRACE: full - # Tests that can be flaky when running with multiple processes `-j 2`. We will use `-j 1` for these. - FLAKY_MP_TESTS: >- - test_multiprocessing_fork - test_multiprocessing_forkserver - test_multiprocessing_spawn # Named after the matrix entry rather than left to be named for it: a # generated name lists every value in the entry, so adding or removing one # renames the check and drops it from the required list. @@ -472,7 +467,6 @@ jobs: - '-u all' - '--timeout 600' - '--dont-add-python-opts' - extra_flaky_mp_tests: [] env_polluting_tests: [] skips: [] timeout: 50 @@ -481,7 +475,6 @@ jobs: - '-u all' - '--timeout 600' - '--dont-add-python-opts' - extra_flaky_mp_tests: [] env_polluting_tests: [] skips: [] timeout: 60 @@ -490,7 +483,6 @@ jobs: - '-u all' - '--timeout 600' - '--dont-add-python-opts' - extra_flaky_mp_tests: [] env_polluting_tests: [] skips: [] timeout: 50 @@ -552,41 +544,15 @@ jobs: - name: Run CPython tests run: | - target/release/rustpython -u -m test --slow-ci -j "$CORES" $EXTRA_TEST_ARGS -x $FLAKY_MP_TESTS $EXTRA_FLAKY_MP_TESTS $SKIPS + target/release/rustpython -u -m test --slow-ci -j "$CORES" $EXTRA_TEST_ARGS $SKIPS timeout-minutes: ${{ matrix.timeout }} shell: bash env: RUSTPYTHON_SKIP_ENV_POLLUTERS: true CORES: ${{ steps.cores.outputs.cores }} EXTRA_TEST_ARGS: ${{ join(matrix.extra_test_args, ' ') }} - EXTRA_FLAKY_MP_TESTS: ${{ join(matrix.extra_flaky_mp_tests, ' ') }} SKIPS: ${{ join(matrix.skips, ' ') }} - - name: Run flaky MP CPython tests - run: | - for attempt in $(seq 1 5); do - echo "::group::Attempt ${attempt}" - - set +e - target/release/rustpython -u -m test --slow-ci -j 1 $EXTRA_TEST_ARGS $FLAKY_MP_TESTS $EXTRA_FLAKY_MP_TESTS - status=$? - set -e - - echo "::endgroup::" - - if [ $status -eq 0 ]; then - exit 0 - fi - done - - exit 1 - timeout-minutes: ${{ matrix.timeout }} - shell: bash - env: - RUSTPYTHON_SKIP_ENV_POLLUTERS: true - EXTRA_TEST_ARGS: ${{ join(matrix.extra_test_args, ' ') }} - EXTRA_FLAKY_MP_TESTS: ${{ join(matrix.extra_flaky_mp_tests, ' ') }} - - name: run cpython tests to check if env polluters have stopped polluting shell: bash run: | diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index 61b395000..f9e48c7c7 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -6269,7 +6269,6 @@ class TestResourceTracker(unittest.TestCase): # restore sigmask to what it was before executing test signal.pthread_sigmask(signal.SIG_SETMASK, orig_sigmask) - @unittest.expectedFailureIf(not hasattr(os, "killpg"), "TODO: RUSTPYTHON") @only_run_in_forkserver_testsuite("avoids redundant testing.") def test_resource_tracker_fork_deadlock(self): # gh-146313: ResourceTracker.__del__ used to deadlock if a forked diff --git a/crates/stdlib/src/multiprocessing.rs b/crates/stdlib/src/multiprocessing.rs index a4e185548..aa9323b0e 100644 --- a/crates/stdlib/src/multiprocessing.rs +++ b/crates/stdlib/src/multiprocessing.rs @@ -134,8 +134,7 @@ mod _multiprocessing { } } - // Poll with signal checking (CPython uses WaitForMultipleObjectsEx - // with sigint_event; we poll since RustPython has no sigint event) + // Poll with signal checking. There is no sigint event to wait on. let poll_ms: u32 = 100; let mut elapsed: u32 = 0; loop {