You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GUI tests that poll the file model for a fixed 2 s fail under CPU load #24
With every CPU core busy, tests/test_gui.py fails in 7 of 10 runs on the branch of #22 (6badf80), always at test_arrow_keys_move_the_preview (tests/test_gui.py:438, assert 0 >= 2: the explorer lists no .tif files). It passes when the machine is idle.
Cause
The test waits for QFileSystemModel to fill the folder with a fixed budget:
That is 2 s. The model fills the folder on a worker thread, and with the cores saturated the thread does not get to run in that time. test_arrow_keys_do_nothing_without_a_preview_tab (line 465) has the same loop, and several tests use a bare pump(200) or pump(400) before reading the tree.
#22 added a wait_until fixture for exactly this and applied it to the filter tests only.
Reproduce
On the branch of #22, with 12 busy-loop processes running (one per logical CPU):
QT_QPA_PLATFORM=offscreen uv run pytest -q -x tests/test_gui.py
3 passed and 7 failed in 10 runs. The filter tests (earlier in the file) passed in all 10, and in 20 more runs of -k "filter or escape or clearing".
Expected
The tests wait on the condition (wait_until(lambda: model.rowCount(root) >= n, describe=...)) instead of a fixed time, so a loaded machine slows them down without failing them. Because -x stopped each failing run at this test, later tests may have the same problem; the count is a lower bound.
Closing as fixed. PR #29 (merged 2026-10-23, 33ef6e7) replaced the fixed 2 s poll with a wait_until of up to 30 s, and PR #26 (merged 2026-10-24, 2b6ebcf) moved the arrow-key tests onto the same wait_for_listing helper. tests/test_gui.py on main has no fixed sleep left.
Activity
test(gui): wait on the listing in the arrow-key tests (#26)
NaNIsaac commentedon Oct 25, 2026
Closing as fixed. PR #29 (merged 2026-10-23, 33ef6e7) replaced the fixed 2 s poll with a wait_until of up to 30 s, and PR #26 (merged 2026-10-24, 2b6ebcf) moved the arrow-key tests onto the same wait_for_listing helper. tests/test_gui.py on main has no fixed sleep left.