From 779ecd527081b1f8b54b396ff5e9be4d37b4d671 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Thu, 14 Dec 2023 23:16:20 -0800 Subject: [PATCH 1/3] Skip test_loop_quicken when executors are active --- Lib/test/test_dis.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index 12e2c57e50b0ba..0bbcac03835ddb 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -1208,9 +1208,8 @@ def test_loop_quicken(self): self.code_quicken(loop_test, 1) got = self.get_disassembly(loop_test, adaptive=True) expected = dis_loop_test_quickened_code - if _testinternalcapi.get_optimizer(): - # We *may* see ENTER_EXECUTOR in the disassembly - got = got.replace("ENTER_EXECUTOR", "JUMP_BACKWARD ") + if _testinternalcapi.get_optimizer() and "ENTER_EXECUTOR" in got: + raise unittest.SkipTest("ENTER_EXECUTOR") self.do_disassembly_compare(got, expected) @cpython_only From eba985667c591f2ae27f13ece33c7906f93ebde8 Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Fri, 15 Dec 2023 08:32:13 -0800 Subject: [PATCH 2/3] Don't skip, just fix --- Lib/test/test_dis.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index 0bbcac03835ddb..3515e1c403dad2 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -1208,8 +1208,14 @@ def test_loop_quicken(self): self.code_quicken(loop_test, 1) got = self.get_disassembly(loop_test, adaptive=True) expected = dis_loop_test_quickened_code - if _testinternalcapi.get_optimizer() and "ENTER_EXECUTOR" in got: - raise unittest.SkipTest("ENTER_EXECUTOR") + if _testinternalcapi.get_optimizer(): + # We *may* see ENTER_EXECUTOR in the disassembly. This is a + # temporary hack to keep the test working until dis is able to + # handle the instruction correctly (GH-112383): + got = got.replace( + "ENTER_EXECUTOR 16", + "JUMP_BACKWARD 16 (to L1)", + ) self.do_disassembly_compare(got, expected) @cpython_only From 32e3caf1742c1043ec8758c2ed2c0ed84ced44dd Mon Sep 17 00:00:00 2001 From: Brandt Bucher Date: Fri, 15 Dec 2023 08:46:01 -0800 Subject: [PATCH 3/3] fixup --- Lib/test/test_dis.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py index 3515e1c403dad2..325457093ec40b 100644 --- a/Lib/test/test_dis.py +++ b/Lib/test/test_dis.py @@ -1209,12 +1209,12 @@ def test_loop_quicken(self): got = self.get_disassembly(loop_test, adaptive=True) expected = dis_loop_test_quickened_code if _testinternalcapi.get_optimizer(): - # We *may* see ENTER_EXECUTOR in the disassembly. This is a - # temporary hack to keep the test working until dis is able to - # handle the instruction correctly (GH-112383): - got = got.replace( - "ENTER_EXECUTOR 16", - "JUMP_BACKWARD 16 (to L1)", + # We *may* see ENTER_EXECUTOR in the disassembly. This is a + # temporary hack to keep the test working until dis is able to + # handle the instruction correctly (GH-112383): + got = got.replace( + "ENTER_EXECUTOR 16", + "JUMP_BACKWARD 16 (to L1)", ) self.do_disassembly_compare(got, expected)