summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_embed.py
diff options
context:
space:
mode:
authorDennis Sweeney <36520290+sweeneyde@users.noreply.github.com>2022-05-03 14:59:12 (GMT)
committerGitHub <noreply@github.com>2022-05-03 14:59:12 (GMT)
commitb156578bd63a94fe3d80a4c6a8dbc067feba5d06 (patch)
treeef52569184e48c4f282032e3f67b519c432c372f /Lib/test/test_embed.py
parent04dc4b06a3afc79a658cacca87ee1d93a34653bd (diff)
downloadcpython-b156578bd63a94fe3d80a4c6a8dbc067feba5d06.zip
cpython-b156578bd63a94fe3d80a4c6a8dbc067feba5d06.tar.gz
cpython-b156578bd63a94fe3d80a4c6a8dbc067feba5d06.tar.bz2
gh-92031: Deoptimize Static Code at Finalization (GH-92039)
Diffstat (limited to 'Lib/test/test_embed.py')
-rw-r--r--Lib/test/test_embed.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py
index 16d1c7d..9bb4bd7 100644
--- a/Lib/test/test_embed.py
+++ b/Lib/test/test_embed.py
@@ -343,6 +343,20 @@ class EmbeddingTests(EmbeddingTestsMixin, unittest.TestCase):
out, err = self.run_embedded_interpreter("test_repeated_init_exec", code)
self.assertEqual(out, 'Tests passed\n' * INIT_LOOPS)
+ @support.skip_if_pgo_task
+ def test_quickened_static_code_gets_unquickened_at_Py_FINALIZE(self):
+ # https://github.com/python/cpython/issues/92031
+ code = """if 1:
+ from importlib._bootstrap import _handle_fromlist
+ import dis
+ for name in dis.opmap:
+ # quicken this frozen code object.
+ _handle_fromlist(dis, [name], lambda *args: None)
+ """
+ run = self.run_embedded_interpreter
+ for i in range(50):
+ out, err = run("test_repeated_init_exec", code, timeout=60)
+
def test_ucnhash_capi_reset(self):
# bpo-47182: unicodeobject.c:ucnhash_capi was not reset on shutdown.
code = "print('\\N{digit nine}')"