test(modal): increase pauses in flaky test (#6116)

* test(modal): increase pauses in flaky test

It looks like `test_modal_pop_screen()` has started being flaky in CI.

Increase the initial pause to ensure the footer is fully composed when
clicked. This seemed to be the fix for a similar flaky test in #6032.

* test(modal): wait refresh for flaky test

After increasing the pause, this test is still flaky in CI. Try adding a
`wait_for_refresh` as well, the same as the fix for a similar flaky test
in #6116
This commit is contained in:
TomJGooding
2025-09-19 20:43:39 +01:00
committed by GitHub
parent 9195904161
commit 606a1686f6

View File

@@ -86,10 +86,14 @@ Button {
async def test_modal_pop_screen():
# https://github.com/Textualize/textual/issues/4656
async with ModalApp().run_test() as pilot:
await pilot.pause()
app = ModalApp()
async with app.run_test() as pilot:
# Pause to ensure the footer is fully composed to avoid flakiness in CI
await pilot.pause(0.4)
await app.wait_for_refresh()
# Check clicking the footer brings up the quit screen
await pilot.click(Footer)
await pilot.pause()
assert isinstance(pilot.app.screen, QuitScreen)
# Check activating the quit button exits the app
await pilot.press("enter")