|
1 | 1 | import contextlib |
2 | 2 | import itertools |
3 | | -import subprocess |
4 | 3 | import sys |
5 | 4 | import textwrap |
6 | 5 | import unittest |
|
10 | 9 |
|
11 | 10 | import _opcode |
12 | 11 |
|
13 | | -from test.support import (SHORT_TIMEOUT, script_helper, requires_specialization, |
| 12 | +from test.support import (script_helper, requires_specialization, |
14 | 13 | import_helper, Py_GIL_DISABLED, requires_jit_enabled, |
15 | 14 | reset_code) |
16 | 15 |
|
@@ -5995,51 +5994,6 @@ def __init__(self, name): |
5995 | 5994 | PYTHON_JIT_SIDE_EXIT_INITIAL_VALUE="1") |
5996 | 5995 | self.assertEqual(result[0].rc, 0, result) |
5997 | 5996 |
|
5998 | | - def test_side_exit_to_executor_makes_progress(self): |
5999 | | - script = textwrap.dedent(""" |
6000 | | - classes = [] |
6001 | | -
|
6002 | | - def make_iter(): |
6003 | | - class It: |
6004 | | - def __init__(self): |
6005 | | - self.i = 0 |
6006 | | -
|
6007 | | - def __iter__(self): |
6008 | | - return self |
6009 | | -
|
6010 | | - def __next__(self): |
6011 | | - self.i += 1 |
6012 | | - if self.i > 1000: |
6013 | | - raise StopIteration |
6014 | | - return self.i |
6015 | | -
|
6016 | | - classes.append(It) |
6017 | | - return It() |
6018 | | -
|
6019 | | - def f(n): |
6020 | | - for outer in range(n): |
6021 | | - for x in make_iter(): |
6022 | | - pass |
6023 | | -
|
6024 | | - f(200) |
6025 | | - """) |
6026 | | - env = os.environ.copy() |
6027 | | - env.update({ |
6028 | | - "PYTHON_JIT": "1", |
6029 | | - "PYTHON_JIT_SIDE_EXIT_INITIAL_VALUE": "1", |
6030 | | - }) |
6031 | | - try: |
6032 | | - result = subprocess.run( |
6033 | | - [sys.executable, "-X", "faulthandler", "-c", script], |
6034 | | - stdout=subprocess.PIPE, |
6035 | | - stderr=subprocess.PIPE, |
6036 | | - env=env, |
6037 | | - timeout=SHORT_TIMEOUT, |
6038 | | - ) |
6039 | | - except subprocess.TimeoutExpired as exc: |
6040 | | - self.fail(f"subprocess timed out: {exc}") |
6041 | | - self.assertEqual(result.returncode, 0, result) |
6042 | | - |
6043 | 5997 | def test_for_iter_gen_cleared_frame_does_not_crash(self): |
6044 | 5998 | # See: https://github.com/python/cpython/issues/145197 |
6045 | 5999 | result = script_helper.run_python_until_end('-c', textwrap.dedent(""" |
|
0 commit comments