Repository navigation
tst_mainwindow: wait for a quiet store tree before staging or negatives - #2423
Conversation
Two notes from the review of #2422: - newSearchTextCancelsAWaitingOpen and acceptedSettingsCancelAWaitingOpen stage the tree by setting a name filter on its model. A reload the new entries set off swaps in a model without it, and the test then skips (kCannotStage), which on a slow runner hides what it is for. - searchMatchesWordsLiterallyAndInOrder checks what the filtered tree does not show; between two models it shows nothing, so those checks could pass without having looked. waitForQuietTree() waits until the tree has been quiet for a second: no reload queued, no fresh model being built, no listing still under way after a swap. The staged tests call it before staging; the search test calls it first and checks at the end that the model it looked at is still the one the tree shows. StoreTree names tst_mainwindow a friend for this, as it does tst_storetree. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anne Jan Brouwer <[email protected]>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
aTreeMenuClosesWhenItsFolderIsGone failed on the macOS runner of #2423 with the menu still open after 30 s. It let the listings settle with a fixed qWait(1000); a reload still building when the folder is removed swaps in a list that has it. It now uses waitForQuietTree(), and when the menu has to be closed the failure names what the tree was doing (reload queued, fresh model, listings under way, current entry, whether the folder exists, watched folders), so a next failure shows which step stalled. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Anne Jan Brouwer <[email protected]>
|
The macOS job failed in |
nogeenhenk
left a comment
There was a problem hiding this comment.
Reviewed at 8340cc4. Test only, plus a friend in storetree.h; it covers both notes from my review of #2422. waitForQuietTree() waits for the three states a swap goes through (m_reloadTimer, m_fresh, m_stillListing), so staging and the negative checks happen on the model the tree keeps. Neither a name filter nor a search touches the disk, so nothing the tests do after the wait sets off another reload. The final check in the search test, that the source model is still the one it looked at, turns a swap during the negatives into a failure instead of a silent pass. Nothing to add.
On the last commit, one note, not blocking. The explanation for the macOS failure, a reload still building when the folder goes and swapping in a list that has it, should not leave the menu open for 30 s in the product: the removal changes the store root, reload() then finds m_fresh busy and sets m_reloadAgain, and the reload after the swap no longer finds the folder. So waiting for a quiet tree makes the test pass, but if that path is what stalled on macOS, a user with a menu open during a pull could hit it too. The state the test now prints on failure is the right way to find out; if it shows up again, I would look at that path before widening the wait.
Generated by Claude Code
Summary
Follow-up to #2422, for the two non-blocking notes in its review.
newSearchTextCancelsAWaitingOpenandacceptedSettingsCancelAWaitingOpenstage the tree by setting a name filter on its model (hideAllBut()). A reload the new entries set off swaps in a model frommakeModel()without that filter. The test then skips withkCannotStage, which on a slow macOS runner hides what it is for.searchMatchesWordsLiterallyAndInOrderchecks what the filtered tree does not show. A tree between two models shows nothing, so those checks passed regardless.tst_mainwindow::waitForQuietTree()waits until the tree has been quiet for a second: no reload queued (m_reloadTimer), no fresh model being built (m_fresh), and no listing still under way after a swap (m_stillListing). The two staged tests call it before staging. The search test calls it first and checks at the end that the model it looked at is still the one the tree shows.StoreTreenamestst_mainwindowa friend for this, as it already doestst_storetree; no product behaviour changes.Test plan
tst_mainwindowthree times in a row: 148 passed, 0 failed; the two skips are the Windows-only and case-insensitive-FS tests, notkCannotStagetst_mainwindowruns in parallel: all 148 passeddoxygen Doxyfileprints no warnings🤖 Generated with Claude Code
Summary by CodeRabbit