test_peg_generator and test_freeze require cpu (#108386)

The test_peg_generator and test_tools.test_freeze tests now require
the 'cpu' resource. Skip these tests unless the 'cpu' resource is
enabled (it is disabled by default).

These tests are no longer skipped if Python is built with ASAN or
MSAN sanitizer.
This commit is contained in:
Victor Stinner 2023-08-24 00:52:48 +02:00 committed by GitHub
parent 3107b453bc
commit 7a6cc3eb66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 10 deletions

View File

@ -4,10 +4,8 @@ from test import support
from test.support import load_package_tests from test.support import load_package_tests
if support.check_sanitizer(address=True, memory=True): # Creating a virtual environment and building C extensions is slow
# gh-90791: Skip the test because it is too slow when Python is built support.requires('cpu')
# with ASAN/MSAN: between 5 and 20 minutes on GitHub Actions.
raise unittest.SkipTest("test too slow on ASAN/MSAN build")
# Load all tests in package # Load all tests in package

View File

@ -7,12 +7,6 @@ from test import support
from test.support import import_helper from test.support import import_helper
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")
if not support.has_subprocess_support: if not support.has_subprocess_support:
raise unittest.SkipTest("test module requires subprocess") raise unittest.SkipTest("test module requires subprocess")

View File

@ -18,6 +18,9 @@ with imports_under_tool('freeze', 'test'):
class TestFreeze(unittest.TestCase): class TestFreeze(unittest.TestCase):
def test_freeze_simple_script(self): def test_freeze_simple_script(self):
# Building Python is slow
support.requires('cpu')
script = textwrap.dedent(""" script = textwrap.dedent("""
import sys import sys
print('running...') print('running...')