Skip to content

Commit 93bbf99

Browse files
committed
Tighten skip guards on test_gdb.test_jit
Require linux + x86_64/aarch64 + sys._jit.is_enabled() so unsupported platforms, arches, and interpreter-only tier-2 builds skip cleanly instead of hanging or failing noisily.
1 parent 0b07c57 commit 93bbf99

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

Lib/test/test_gdb/test_jit.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import platform
23
import re
34
import sys
45
import unittest
@@ -54,10 +55,18 @@ def setUpModule():
5455
setup_module()
5556

5657

57-
@unittest.skipUnless(
58-
hasattr(sys, "_jit") and sys._jit.is_available(),
59-
"requires a JIT-enabled build",
60-
)
58+
# The GDB JIT interface registration is gated on __linux__ && __ELF__ in
59+
# Python/jit_unwind.c, and the synthetic EH-frame is only implemented for
60+
# x86_64 and AArch64 (a #error fires otherwise). Skip cleanly on other
61+
# platforms or architectures instead of producing timeouts / empty backtraces.
62+
# is_enabled() implies is_available() and also implies that the runtime has
63+
# JIT execution active; interpreter-only tier 2 builds don't hit this path.
64+
@unittest.skipUnless(sys.platform == "linux",
65+
"GDB JIT interface is only implemented for Linux + ELF")
66+
@unittest.skipUnless(platform.machine() in ("x86_64", "aarch64"),
67+
"GDB JIT CFI emitter only supports x86_64 and AArch64")
68+
@unittest.skipUnless(hasattr(sys, "_jit") and sys._jit.is_enabled(),
69+
"requires a JIT-enabled build with JIT execution active")
6170
class JitBacktraceTests(DebuggerTests):
6271
def test_bt_shows_compiled_jit_entry(self):
6372
gdb_output = self.get_stack_trace(

0 commit comments

Comments
 (0)