mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-06 14:06:32 -04:00
The integration test filter_and_search/search_a_long_diff fails now and then on CI with "Expected search prompt to be focused". Pressing "/" in the focused main view reads the rest of the diff with ReadToEnd. Its callback opens the prompt by enqueueing the work onto the UI thread. ReadToEnd marks its task as done before calling the callback, so for a moment no task is busy. If the idle wait of the test driver wakes up in that moment, the test checks for the prompt before it is open. Adding a sleep between the two calls makes the test fail every time. The same gap exists when going to the bottom of a view, since that callback enqueues its work onto the UI thread too. Call the callback first, and mark the task as done after it returns. The work that the callback enqueues holds a task of its own from the moment it is enqueued, so lazygit no longer counts as idle in between. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>