Skip to content

Commit

Permalink
pythongh-108388: test_concurrent_futures requires cpu
Browse files Browse the repository at this point in the history
The test_concurrent_futures and test_multiprocessing_spawn tests now
require the 'cpu' resource. Skip these tests unless the 'cpu'
resource is enabled (it is disabled by default).

test_concurrent_futures is no longer skipped if Python is built with
ASAN or MSAN sanitizer.
  • Loading branch information
vstinner committed Aug 23, 2023
1 parent 7a6cc3e commit 83becc5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Lib/test/test_concurrent_futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@
import multiprocessing as mp


if support.check_sanitizer(address=True, memory=True):
# gh-90791: Skip the test because it is too slow when Python is built
# with ASAN/MSAN: between 5 and 20 minutes on GitHub Actions.
raise unittest.SkipTest("test too slow on ASAN/MSAN build")
# This test spawns many threads and processes and is slow
support.requires('cpu')


def create_future(state=PENDING, exception=None, result=None):
Expand Down
3 changes: 3 additions & 0 deletions Lib/test/test_multiprocessing_spawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

from test import support

# This test spawns many processes and is slow
support.requires('cpu')

if support.PGO:
raise unittest.SkipTest("test is not helpful for PGO")

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The slowest tests are now skipped by default, unless the "cpu" resource is
enabled: test_concurrent_futures, test_multiprocessing_spawn,
test_peg_generator and test_tools.test_freeze. Run the test suite with ``-u
cpu`` or ``-u all`` to run these tests. Moreover, these tests are no longer
skipped on Python built with ASAN or MSAN sanitizer. Patch by Victor
Stinner.

0 comments on commit 83becc5

Please sign in to comment.