Skip to content

Commit 606a168

Browse files
authored
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
1 parent 9195904 commit 606a168

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/test_modal.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,14 @@ def check_quit(quit: bool | None) -> None:
8686
async def test_modal_pop_screen():
8787
# https://github.com/Textualize/textual/issues/4656
8888

89-
async with ModalApp().run_test() as pilot:
90-
await pilot.pause()
89+
app = ModalApp()
90+
async with app.run_test() as pilot:
91+
# Pause to ensure the footer is fully composed to avoid flakiness in CI
92+
await pilot.pause(0.4)
93+
await app.wait_for_refresh()
9194
# Check clicking the footer brings up the quit screen
9295
await pilot.click(Footer)
96+
await pilot.pause()
9397
assert isinstance(pilot.app.screen, QuitScreen)
9498
# Check activating the quit button exits the app
9599
await pilot.press("enter")

0 commit comments

Comments
 (0)