gh-150387: Fix hang in test_run_failed_script_live on slow buildbots#150405
Open
pablogsal wants to merge 1 commit into
Open
gh-150387: Fix hang in test_run_failed_script_live on slow buildbots#150405pablogsal wants to merge 1 commit into
pablogsal wants to merge 1 commit into
Conversation
…dbots The test relied on the failing script (``1/0``) crashing fast enough that fewer than ``MIN_SAMPLES_FOR_TUI`` (200) samples were collected, which would trigger the early-return path in ``sample.sample_live`` and bypass the TUI input loop. On slow buildbots (ASan, TraceRefs, NoGIL) the interpreter takes long enough to bootstrap and reach the ``1/0`` that the profiler easily collects >=200 samples, pushing execution into the ``while collector.running:`` loop. Because the mock only queued a final ``q`` keystroke when ``n_times >= 500`` (and the failed-script test used ``n_times=200``), nothing ever set ``running`` to ``False`` and the test hung until the regrtest timeout. Always queue the final ``q`` so the live TUI loop exits regardless of how many samples were collected.
|
🤖 New build scheduled with the buildbot fleet by @pablogsal for commit 0f17e0b 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F150405%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The test relied on the failing script (
1/0) crashing fast enough that fewer thanMIN_SAMPLES_FOR_TUI(200) samples were collected, which would trigger the early-return path insample.sample_liveand bypass the TUI input loop. On slow buildbots (ASan, TraceRefs, NoGIL) the interpreter takes long enough to bootstrap and reach the1/0that the profiler easily collects >=200 samples, pushing execution into thewhile collector.running:loop. Because the mock only queued a finalqkeystroke whenn_times >= 500(and the failed-script test usedn_times=200), nothing ever setrunningtoFalseand the test hung until the regrtest timeout.Always queue the final
qso the live TUI loop exits regardless of how many samples were collected.