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
tst_mainwindow: look tree rows up in the model the tree shows now - #2422
The third macOS failure in tst_mainwindow since #2409, each around timing in the tree. This one was shareMenuReencryptAsksFirst on #2418: triggerShareAction() returned false right after the test created gone-folder.
Cause: since #2409 a change to the store makes StoreTree::reload() put a newQFileSystemModel under the proxy (swapInFresh()). The test helpers fetched the source model once and waited on it. When the swap came in between, they mapped an index of the retired model through the proxy, which gives an invalid index: no current row, so the helper gave up.
sourceIndexFor() / shownIndexFor(): read the model from the tree on every look.
selectEntry(), addEntry(), selectListed(), selectPath(), triggerShareAction(), the linked-Bank test and searchMatchesWordsLiterallyAndInOrder use them; the waits are 10 s instead of 5 s.
triggerShareAction() also waits after the search until the filtered tree shows the folder where a click lands, instead of checking once.
The waits stay on the source index, so a helper still returns false (without a test failure) for a row the tree hides on purpose, as deleteLinkedFolderRemovesOnlyTheLink expects for an entry behind a link.
Test-only; no product code changes.
Test plan
tst_mainwindow three times in a row: 148 passed, 0 failed
Six tst_mainwindow runs in parallel (load): all 148 passed
Since #2409 a change to the store makes StoreTree::reload() put a new
QFileSystemModel under the proxy. The tree helpers fetched the source
model once and waited on it, so a swap in between left them mapping an
index of the retired model through the proxy: an invalid current index,
and on a slow macOS runner shareMenuReencryptAsksFirst failed in
triggerShareAction() right after it made gone-folder.
sourceIndexFor() and shownIndexFor() read the model from the tree on
every look. selectEntry(), addEntry(), selectListed(), selectPath(),
triggerShareAction(), the linked-Bank test and the literal-search test
use them, and the waits are 10 s instead of 5 s. triggerShareAction()
also waits after the search until the filtered tree shows the folder
where a click lands, instead of checking once.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Anne Jan Brouwer <[email protected]>
Reviewing files that changed from the base of the PR and between d9c1ef8 and 65c4d96.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
MainWindow tests now look up source and displayed indexes from the tree’s current models. Several test waits increase from 5 to 10 seconds. The share-action helper also waits for the folder row to become visible and clickable.
Changes: MainWindow test lookup updates
Layer / File(s)
Summary
Current-model index lookups tests/auto/mainwindow/tst_mainwindow.cpp
Selection and search checks retrieve indexes from the current source and proxy models. The share-action helper waits for the folder row to appear and become clickable.
IJHack/QtPass#2409: It changes StoreTree model replacement behavior, which relates to the test updates that reacquire indexes from the current model.
Suggested reviewers:nogeenhenk
Merge Risk: Minimal · previous review d9c1e
This change only updates test helpers to look up the current models and extends some waits. It does not affect product behavior, and no merge-blocking issue was found.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the test-only change: tst_mainwindow helpers now look up tree rows in the model the tree currently shows. The raw summary confirms the changes to sourceIndexFor/shownIndexFor helpers, …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the test-only change: tst_mainwindow helpers now look up tree rows in the model the tree currently shows. The raw summary confirms the changes to sourceIndexFor/shownIndexFor helpers, selection and visibility checks, and waits in tst_mainwindow.cpp. The title is specific and matches the primary change. It does not mention the 10-second waits or the triggerShareAction change, which is acceptable because the title need not cover every detail.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks the tree anew, For rows that shift from old to new. It waits until the paths appear, Then clicks the folder, calm and clear. Fresh indexes guide the tests along, While patient paws ensure they’re strong.
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Reviewing files that changed from the base of the PR and between d2553bf and d9c1ef8.
Files selected for processing: 1
tests/auto/mainwindow/tst_mainwindow.cpp
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Reviewed at d9c1ef8. Test only. The diagnosis matches the three macOS failures since #2409 (aTreeMenuClosesWhenItsFolderIsGone, refreshAfterPushGivesWayToTheUser, shareMenuReencryptAsksFirst): a helper that fetched the source model once and waited on it could map an index of the model swapInFresh() had just retired. Reading the model from the tree on every look, and waiting in triggerShareAction() until the filtered tree shows the folder where a click lands, closes that.
Two notes, not blocking:
hideAllBut() and showLoaded() still set name filters on the source model of the moment. A reload swaps in a model from makeModel() with the *.gpg filter again, so a hide staged that way can come undone. The tests that use it detect that and QSKIP(kCannotStage), so it shows up as a skip, not a failure, but a skip on the slow macOS runner may hide what the test is for.
The negative checks right after a filter (!shown(notes), and both after "(") also pass while the tree is between models and shows nothing. They cannot fail spuriously, but they can pass without having looked.
CI: every check is green, the macOS test job included, which is the one this PR is about. Only macOS dmg was cancelled without a step result, a shortage of macOS runners at GitHub; the maintainer asked me not to count it.
The reason will be displayed to describe this comment to others. Learn more.
Reviewed at d9c1ef8; 65c4d96 only merges main (#2418) into it. Test only. The diagnosis matches the three macOS failures since #2409 (aTreeMenuClosesWhenItsFolderIsGone, refreshAfterPushGivesWayToTheUser, shareMenuReencryptAsksFirst): a helper that fetched the source model once and waited on it could map an index of the model swapInFresh() had just retired. Reading the model from the tree on every look, and waiting in triggerShareAction() until the filtered tree shows the folder where a click lands, closes that.
Two notes, not blocking:
hideAllBut() and showLoaded() still set name filters on the source model of the moment. A reload swaps in a model from makeModel() with the *.gpg filter again, so a hide staged that way can come undone. The tests that use it detect that and QSKIP(kCannotStage), so it shows up as a skip, not a failure, but a skip on the slow macOS runner may hide what the test is for.
The negative checks right after a filter (!shown(notes), and both after "(") also pass while the tree is between models and shows nothing. They cannot fail spuriously, but they can pass without having looked.
CI: every check is green, the macOS test job included, which is the one this PR is about. Only macOS dmg was cancelled without a step result, a shortage of macOS runners at GitHub; the maintainer asked me not to count it.
…es (#2423)
Follow-up to #2422, for the notes in its review, plus the fourth macOS
tree flake.
waitForQuietTree() waits until the store tree has been quiet for a
second: no reload queued, no fresh model being built, no listing still
under way after a swap. StoreTree names tst_mainwindow a friend for it.
- newSearchTextCancelsAWaitingOpen and acceptedSettingsCancelAWaitingOpen
call it before staging a name filter, so a swap cannot undo the stage
and turn the test into a kCannotStage skip.
- searchMatchesWordsLiterallyAndInOrder calls it first and checks at the
end that the model it looked at is still the tree's, so its "not shown"
checks cannot pass on a tree between two models.
- aTreeMenuClosesWhenItsFolderIsGone uses it instead of a fixed
qWait(1000), and when the menu has to be closed the failure names the
tree's state, so a next macOS failure shows which step stalled.
Test-only apart from the friend declaration.
Signed-off-by: Anne Jan Brouwer <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The third macOS failure in
tst_mainwindowsince #2409, each around timing in the tree. This one wasshareMenuReencryptAsksFirston #2418:triggerShareAction()returned false right after the test createdgone-folder.Cause: since #2409 a change to the store makes
StoreTree::reload()put a newQFileSystemModelunder the proxy (swapInFresh()). The test helpers fetched the source model once and waited on it. When the swap came in between, they mapped an index of the retired model through the proxy, which gives an invalid index: no current row, so the helper gave up.sourceIndexFor()/shownIndexFor(): read the model from the tree on every look.selectEntry(),addEntry(),selectListed(),selectPath(),triggerShareAction(), the linked-Banktest andsearchMatchesWordsLiterallyAndInOrderuse them; the waits are 10 s instead of 5 s.triggerShareAction()also waits after the search until the filtered tree shows the folder where a click lands, instead of checking once.deleteLinkedFolderRemovesOnlyTheLinkexpects for an entry behind a link.Test-only; no product code changes.
Test plan
tst_mainwindowthree times in a row: 148 passed, 0 failedtst_mainwindowruns in parallel (load): all 148 passed🤖 Generated with Claude Code
Summary by CodeRabbit