diff --git a/tests/browser/slow_reset_watch.py b/tests/browser/slow_reset_watch.py index d2c07009..a3f6a6c8 100644 --- a/tests/browser/slow_reset_watch.py +++ b/tests/browser/slow_reset_watch.py @@ -114,10 +114,16 @@ def thread_stacks() -> list[str]: Formatting sys._current_frames() showed a thread blocked in SQLite as idle (Python 3.14); faulthandler reports where each thread really is. """ + # Before Python 3.14 faulthandler prints ids only; name each id here. + names = [ + f"thread 0x{thread.ident:016x} is {thread.name}" + for thread in threading.enumerate() + if thread.ident is not None + ] with tempfile.TemporaryFile() as dump: faulthandler.dump_traceback(file=dump, all_threads=True) dump.seek(0) - return dump.read().decode("utf-8", "replace").splitlines() + return [*names, *dump.read().decode("utf-8", "replace").splitlines()] def executor_state(loop: asyncio.AbstractEventLoop) -> list[str]: diff --git a/tests/test_browser_slow_reset_watch.py b/tests/test_browser_slow_reset_watch.py index 9a5626b9..bb24c53b 100644 --- a/tests/test_browser_slow_reset_watch.py +++ b/tests/test_browser_slow_reset_watch.py @@ -71,7 +71,7 @@ class TestResetWatch(unittest.TestCase): text = "\n".join(report) self.assertIn("POST /__test__/reset still running after", text) self.assertIn("database: 1 connections", text) - self.assertIn("[held-up]", text) + self.assertIn(f"thread 0x{worker.ident:016x} is held-up", text) self.assertIn("in blocked_here", text) watch.record_call("seed", 0.25, 1.5)