Repository navigation
test: wait for the OLM wizard to finish mounting before leaving it - #505
Merged
Merged
Conversation
A screen is current as soon as it is pushed, before its widgets run their Mount handlers. The OLM wizard tests waited only for the screen, so on a slow Windows runner run_test tore the wizard down while Textual's Select._on_mount was still looking up its overlay, and main's CI failed with NoMatches on a docs-only merge. screen_ready in tests/ui/waits.py holds until the screen and every widget in it have mounted, and the six wizard waits use it. Closes #504. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🔵 Needs a closer look
One or more reviewer sessions failed, leaving the review evidence incomplete.
No open issues 🎉
What changed in this PR
This test-only PR addresses the OLM wizard mount race reported in #504 by waiting for the screen and its widgets to finish mounting before interacting with them or ending the test.
Changes:
- Adds a shared
screen_readypredicate for mount-completion checks. - Updates all six affected wizard waits to use it.
- Adds parametrized checks and a real Textual modal test containing a
Select.
| File | Description |
|---|---|
tests/ui/waits.py |
Adds the screen-and-widget mount readiness predicate. |
tests/ui/test_write_confirm_characterization.py |
Updates one wizard wait before accepting defaults. |
tests/ui/test_waits.py |
Tests readiness states and actual Select mounting. |
tests/ui/test_olm_view.py |
Updates five wizard waits to require mount completion. |
Review effort: Balanced
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.
Closes #504
Summary
main's CI failed on a7417a0 (the #500 merge, docs only) inwindows-test:test_olm_view.py::test_install_fetches_manifest_by_canonical_view_kind.NoMatches: No nodes match 'SelectOverlay' on Select(id='install-channel').run_test's__aexit__into Textual'sSelect._on_mount.A screen is current as soon as it is pushed, before its widgets run their Mount handlers. The OLM wizard tests waited only for the screen, so on a slow runner they left
run_testwhileSelect._on_mountwas still looking up its overlay. This is a test race, not a product bug.tests/ui/waits.pygainsscreen_ready(app, screen_type). It holds until the screen and every widget in it have finished mounting.test_olm_view.pyand one intest_write_confirm_characterization.py.Verification
uv run pytest -p no:tach tests/ui/test_waits.py -q: 8 passed.Selectand asserts theSelectis mounted oncescreen_readyholds.screen_readywithreturn Truemakes that test fail locally: right after a push, theSelecthas not mounted yet. That is the race Windows: an OLM wizard test leaves run_test while its Select is still mounting #504 hit, reproduced deterministically.uv run pytest -n 8 -p no:tach tests/ui/ -q: 3611 passed.ruff check,ruff format --checkandmypyon the touched files: clean.Checklist
make checkpasses locally. (Test-only change. The UI suite and lint/type checks on the touched files were run; the full suite runs in CI.)and a fail-closed audit entry, and sensitive reads are still masked.