From c0e8c746e6ab93c97ac5d478e8bef2fa9c308390 Mon Sep 17 00:00:00 2001 From: Ben Davidson Date: Wed, 11 Nov 2026 22:42:22 +1030 Subject: [PATCH] test: let the first preview land in the new-query strand tests #262 moved the parked-mount tests onto `first_preview_landed` but missed this file. Both tests still took over `mount_task` as soon as results showed, so the app's own first decode could report back and cancel the parked mount before it reached `cancel_task_on` (macOS CI on #267: "the mount never reached its early await"). Holding the app's decode back (0.1 s off-thread `get_file_chunks`, slow `remove_children`) fails one or both tests 3 of 3 runs without this and passes 3 of 3 with it. --- tests/test_preview_new_query_strand.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_preview_new_query_strand.py b/tests/test_preview_new_query_strand.py index 3a1040d3..df08a792 100644 --- a/tests/test_preview_new_query_strand.py +++ b/tests/test_preview_new_query_strand.py @@ -23,7 +23,7 @@ from fnd.tui import FNDApp from fnd.tui.widgets.preview_container import PreviewContainer from tests._mount_gate import MountGate -from tests._pilot_wait import run_search, safe_pause, wait_until +from tests._pilot_wait import first_preview_landed, run_search, safe_pause @pytest.fixture @@ -38,7 +38,7 @@ async def test_new_query_during_inflight_mount_purges_stale_container( ) -> None: app = FNDApp(index_dir=built_index, initial_query="results") async with app.run_test() as pilot: - await wait_until(pilot, lambda: bool(app._search.groups), message="setup: no results") + await first_preview_landed(pilot, app) preview = app._preview # Gate the cold structural mount in its early-await window so it sits @@ -102,7 +102,7 @@ async def test_superseded_mount_cancels_detached_finaliser(built_index: Path) -> """ app = FNDApp(index_dir=built_index, initial_query="results") async with app.run_test() as pilot: - await wait_until(pilot, lambda: bool(app._search.groups), message="setup: no results") + await first_preview_landed(pilot, app) preview = app._preview gate = MountGate(app)