Skip to content

Split long running test suites up into smaller sub suites to reduce our regrtest long tail on multi-core systems. #108388

Description

@vstinner

The slowest tests of the Python test suite are:

  • test_concurrent_futures
  • test_multiprocessing_spawn
  • test_peg_generator
  • test_tools.test_freeze tests

They each tend take multiple minutes to run. The bulk of our others take <10 seconds. They occupy a lot of wall time as a long tail in a normal make test or regrtest run on a typical parallel run multi-core systems.

This bug originally proposed to skip them unless the "cpu" resource is enabled (it's disabled by default). That was deemed appropriate for test_peg_generator and test_tools.test_freeze which are either not platform specific or rarely needed in CI. (PR #108386) - This PR reduced the total test duration between 3 and 5 minutes.

Linked PRs

Activity

  1. added 11 commits that reference this issue on Aug 23, 2023
  2. added a commit that references this issue on Aug 24, 2023
  3. added 2 commits that reference this issue on Aug 24, 2023
  4. 12 remaining items

  5. added
    3.12only security fixes
    buildThe build process and cross-build
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Aug 24, 2023
  6. sobolevn commented on Aug 25, 2023

    @sobolevn
    Member

    I experience new failures of test_concurrent_futures on Windows on my unrelated PR: https://github.com/python/cpython/actions/runs/5972558288/job/16203298171?pr=108456

    Failing tests:

         test.test_concurrent_futures.test_deadlock
         test.test_concurrent_futures.test_shutdown
    
  7. vstinner commented on Aug 25, 2023

    @vstinner
    MemberAuthor

    I experience new failures of test_concurrent_futures on Windows on my unrelated PR

    Sadly, the issue is known for at least one month: see issue #107219.

    Logs:

      File "D:\a\cpython\cpython\Lib\test\test_concurrent_futures\test_deadlock.py", line 236 in test_crash_big_data
    

    It's this test which hangs sometimes on Windows.

  8. added 2 commits that reference this issue on Aug 25, 2023
  9. added 2 commits that reference this issue on Sep 2, 2023
  10. vstinner commented on Sep 13, 2023

    @vstinner
    MemberAuthor

    This feature has been implemented in the main branch, and backported to the 3.12 branch. I don't think that it's worth it to backport it to the 3.11 branch.

    I splitted these test packages:

    • test_concurrent_futures
    • test_multiprocessing_fork
    • test_multiprocessing_forkserver
    • test.test_multiprocessing_spawn

    Example:

    $ ./python -m test test_concurrent_futures --list-tests
    test_concurrent_futures.test_as_completed
    test_concurrent_futures.test_deadlock
    test_concurrent_futures.test_future
    test_concurrent_futures.test_init
    test_concurrent_futures.test_process_pool
    test_concurrent_futures.test_shutdown
    test_concurrent_futures.test_thread_pool
    test_concurrent_futures.test_wait
    

    I close my issue.

  11. added a commit that references this issue on Sep 21, 2023
  12. added 3 commits that reference this issue on Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixesbuildThe build process and cross-buildtestsTests in the Lib/test dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions