]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-150387: Fix hang in test_run_failed_script_live on slow buildbots (#150405)
authorPablo Galindo Salgado <Pablogsal@gmail.com>
Mon, 25 May 2026 18:17:00 +0000 (19:17 +0100)
committerGitHub <noreply@github.com>
Mon, 25 May 2026 18:17:00 +0000 (19:17 +0100)
Lib/test/test_profiling/test_sampling_profiler/test_live_collector_ui.py
Misc/NEWS.d/next/Tests/2026-05-25-15-39-53.gh-issue-150387.yzZ7jq.rst [new file with mode: 0644]

index c0d39f487c8cbdf601fe3684004696bfaecf9084..59373a8d00c03cf1d8d1826dc21cfc777960a8f3 100644 (file)
@@ -835,8 +835,7 @@ class TestLiveModeErrors(unittest.TestCase):
         # still failing
         for _ in range(n_times):
             mock_self.display.simulate_input(-1)
-        if n_times >= 500:
-            mock_self.display.simulate_input(ord('q'))
+        mock_self.display.simulate_input(ord('q'))
 
     def test_run_failed_module_live(self):
         """Test that running a existing module that fails exits with clean error."""
diff --git a/Misc/NEWS.d/next/Tests/2026-05-25-15-39-53.gh-issue-150387.yzZ7jq.rst b/Misc/NEWS.d/next/Tests/2026-05-25-15-39-53.gh-issue-150387.yzZ7jq.rst
new file mode 100644 (file)
index 0000000..663a357
--- /dev/null
@@ -0,0 +1,5 @@
+Fix hang in
+``test.test_profiling.test_sampling_profiler.test_live_collector_ui.TestLiveModeErrors.test_run_failed_script_live``
+on slow buildbots. The test now always queues a final ``q`` keystroke so the
+live TUI loop exits even when the profiler collects enough samples to enter
+the post-finished input loop.