Repository navigation
[Testing] Wait for the Windows overflow menu to close before the Shell test reopens it - #40359
Conversation
…pens it again TabWithSeveralShellContentsOpensFromTabBarOverflowMenu clicks a tab in the tab bar overflow menu, which hides the menu, and then opens the same menu again. Hide only closes the popup of the flyout. WinUI keeps the flyout registered as open until its presenter unloads and raises Closed, and ShowAt on that same flyout and target is ignored until then. When navigation was observed before the presenter unloaded, the test called ShowAt too early and failed with "The overflow menu did not open again". Wait for Closed after the clicks that close the menu, before it is opened again. The assertions, messages and deadlines are unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
/rebase |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
PR Test Gate
🧪 Gate analysis — click to expand⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect. No interpretable test-group summary was produced. No additional test execution is inferred. Setup did not capture a verified PR head; no commit is claimed as tested. No immutable without-fix baseline was prepared. |
There was a problem hiding this comment.
Expert Review — 0 findings
Reviewed commit faf14fc.
This comment has been minimized.
This comment has been minimized.
Tests Failure Analysis🧪 CI Analysis — click to expand📊 maui-pr
🧪 maui-pr-devicetests
Comparable target-branch diagnostics are missing for these device cases. 🧪 maui-pr-uitestsNo failures found. 🧭 Follow-up — actions and refreshNext action: Check versioning inputs; retrieve missing diagnostics and parameterized target results; verify iOS completion.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Attribution for the tests-failure analysis of
|
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Expert Review — 0 findings
Reviewed commit faf14fc.
PR Test Gate
🧪 Gate analysis — click to expand⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect. No interpretable test-group summary was produced. No additional test execution is inferred. Setup did not capture a verified PR head; no commit is claimed as tested. No immutable without-fix baseline was prepared. |
…l test reopens it (#40359) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). This is a test-only fix for the SR2 candidate validation in #40116, so it targets `candidate/11.0.1xx-sr2`, like the earlier candidate test fixes. ### Description of Change On candidate head `888db82bd5`, Windows device-test build 1686840 failed `ShellTests.TabWithSeveralShellContentsOpensFromTabBarOverflowMenu` (run 47076696, result 102198) at `ShellTabBarTests.Windows.cs:276` with `The overflow menu did not open again`. That test came in with #39412. **Root cause (test timing):** 1. The test clicks "Tab 7", and later "Sub B", in the tab bar overflow menu. Both tabs select on invoke, so the click hides the menu. 2. Hiding only closes the flyout's popup. WinUI keeps the `MenuFlyout` registered as open until its presenter unloads and raises `Closed`. Until then, `ShowAt` on the same flyout and target is ignored. 3. The test waits for navigation and then reopens the menu with `ShowAt`. Navigation is usually observed after the presenter has unloaded, but not always. When it's observed first, `ShowAt` is a no-op and `IsOpen` never becomes true. **Fix:** a new helper, `ClickOverflowMenuItemThatClosesMenu`, waits for `Flyout.Closed` after the two clicks that close the menu, before the menu is reopened. The diff is +21/−2 in `ShellTabBarTests.Windows.cs` only. Assertions, messages, deadlines and test cases are unchanged. No product code changes. **Causal evidence (Helix `Windows.11.Amd64.Client.Open`, Controls device tests, Shell category):** A temporary, uncommitted probe (`OverflowProbe*`, never committed) runs alongside the real tests: - **A (trigger):** clicks "Sub B" and calls `ShowAt` at once, as when navigation is observed before the presenter unloads. - **B (trigger + fix):** the same, but clicks with this PR's helper. - **C (real test):** `TabWithSeveralShellContentsOpensFromTabBarOverflowMenu`, 20 iterations. - **D (trigger removed):** the original order, which waits for navigation before reopening. | Leg | Helper wait present | A trigger | B trigger + helper | C real test | D no trigger | Real overflow tests | | --- | --- | --- | --- | --- | --- | --- | | fix | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | reverted (r1) | no | — | — | — | — | not run: the probe edit failed to build (CS0219) | | reverted (r2) | no | red 10/10 | **red 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r1) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r2) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | Each leg's payload records `variant.json` with `fixWaitPresent` and SHA-256s of the test and probe files. - Helix jobs: `509c2c0a-230d-4310-9524-199f5d1858e9` (r1) and `c16a74fd-9a5b-4979-b7a9-22d0519b5755` (r2). - r1's reverted leg failed to compile, so r2 repeated the matrix with a corrected revert. - A shows the trigger reproduces `did not open again` every time without the wait. - B flips red when only the helper's `Closed` wait is removed, and green again when it's restored. - C and D show the original race is rare. The real test passes in these legs, consistent with a single CI failure. I found no duplicate open or merged PR for this test or mechanism. ### Issues Fixed No issue filed. Found during SR2 candidate validation (#40116). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…l test reopens it (#40359) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). This is a test-only fix for the SR2 candidate validation in #40116, so it targets `candidate/11.0.1xx-sr2`, like the earlier candidate test fixes. ### Description of Change On candidate head `888db82bd5`, Windows device-test build 1686840 failed `ShellTests.TabWithSeveralShellContentsOpensFromTabBarOverflowMenu` (run 47076696, result 102198) at `ShellTabBarTests.Windows.cs:276` with `The overflow menu did not open again`. That test came in with #39412. **Root cause (test timing):** 1. The test clicks "Tab 7", and later "Sub B", in the tab bar overflow menu. Both tabs select on invoke, so the click hides the menu. 2. Hiding only closes the flyout's popup. WinUI keeps the `MenuFlyout` registered as open until its presenter unloads and raises `Closed`. Until then, `ShowAt` on the same flyout and target is ignored. 3. The test waits for navigation and then reopens the menu with `ShowAt`. Navigation is usually observed after the presenter has unloaded, but not always. When it's observed first, `ShowAt` is a no-op and `IsOpen` never becomes true. **Fix:** a new helper, `ClickOverflowMenuItemThatClosesMenu`, waits for `Flyout.Closed` after the two clicks that close the menu, before the menu is reopened. The diff is +21/−2 in `ShellTabBarTests.Windows.cs` only. Assertions, messages, deadlines and test cases are unchanged. No product code changes. **Causal evidence (Helix `Windows.11.Amd64.Client.Open`, Controls device tests, Shell category):** A temporary, uncommitted probe (`OverflowProbe*`, never committed) runs alongside the real tests: - **A (trigger):** clicks "Sub B" and calls `ShowAt` at once, as when navigation is observed before the presenter unloads. - **B (trigger + fix):** the same, but clicks with this PR's helper. - **C (real test):** `TabWithSeveralShellContentsOpensFromTabBarOverflowMenu`, 20 iterations. - **D (trigger removed):** the original order, which waits for navigation before reopening. | Leg | Helper wait present | A trigger | B trigger + helper | C real test | D no trigger | Real overflow tests | | --- | --- | --- | --- | --- | --- | --- | | fix | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | reverted (r1) | no | — | — | — | — | not run: the probe edit failed to build (CS0219) | | reverted (r2) | no | red 10/10 | **red 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r1) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r2) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | Each leg's payload records `variant.json` with `fixWaitPresent` and SHA-256s of the test and probe files. - Helix jobs: `509c2c0a-230d-4310-9524-199f5d1858e9` (r1) and `c16a74fd-9a5b-4979-b7a9-22d0519b5755` (r2). - r1's reverted leg failed to compile, so r2 repeated the matrix with a corrected revert. - A shows the trigger reproduces `did not open again` every time without the wait. - B flips red when only the helper's `Closed` wait is removed, and green again when it's restored. - C and D show the original race is rare. The real test passes in these legs, consistent with a single CI failure. I found no duplicate open or merged PR for this test or mechanism. ### Issues Fixed No issue filed. Found during SR2 candidate validation (#40116). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…l test reopens it (#40359) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). This is a test-only fix for the SR2 candidate validation in #40116, so it targets `candidate/11.0.1xx-sr2`, like the earlier candidate test fixes. ### Description of Change On candidate head `888db82bd5`, Windows device-test build 1686840 failed `ShellTests.TabWithSeveralShellContentsOpensFromTabBarOverflowMenu` (run 47076696, result 102198) at `ShellTabBarTests.Windows.cs:276` with `The overflow menu did not open again`. That test came in with #39412. **Root cause (test timing):** 1. The test clicks "Tab 7", and later "Sub B", in the tab bar overflow menu. Both tabs select on invoke, so the click hides the menu. 2. Hiding only closes the flyout's popup. WinUI keeps the `MenuFlyout` registered as open until its presenter unloads and raises `Closed`. Until then, `ShowAt` on the same flyout and target is ignored. 3. The test waits for navigation and then reopens the menu with `ShowAt`. Navigation is usually observed after the presenter has unloaded, but not always. When it's observed first, `ShowAt` is a no-op and `IsOpen` never becomes true. **Fix:** a new helper, `ClickOverflowMenuItemThatClosesMenu`, waits for `Flyout.Closed` after the two clicks that close the menu, before the menu is reopened. The diff is +21/−2 in `ShellTabBarTests.Windows.cs` only. Assertions, messages, deadlines and test cases are unchanged. No product code changes. **Causal evidence (Helix `Windows.11.Amd64.Client.Open`, Controls device tests, Shell category):** A temporary, uncommitted probe (`OverflowProbe*`, never committed) runs alongside the real tests: - **A (trigger):** clicks "Sub B" and calls `ShowAt` at once, as when navigation is observed before the presenter unloads. - **B (trigger + fix):** the same, but clicks with this PR's helper. - **C (real test):** `TabWithSeveralShellContentsOpensFromTabBarOverflowMenu`, 20 iterations. - **D (trigger removed):** the original order, which waits for navigation before reopening. | Leg | Helper wait present | A trigger | B trigger + helper | C real test | D no trigger | Real overflow tests | | --- | --- | --- | --- | --- | --- | --- | | fix | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | reverted (r1) | no | — | — | — | — | not run: the probe edit failed to build (CS0219) | | reverted (r2) | no | red 10/10 | **red 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r1) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r2) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | Each leg's payload records `variant.json` with `fixWaitPresent` and SHA-256s of the test and probe files. - Helix jobs: `509c2c0a-230d-4310-9524-199f5d1858e9` (r1) and `c16a74fd-9a5b-4979-b7a9-22d0519b5755` (r2). - r1's reverted leg failed to compile, so r2 repeated the matrix with a corrected revert. - A shows the trigger reproduces `did not open again` every time without the wait. - B flips red when only the helper's `Closed` wait is removed, and green again when it's restored. - C and D show the original race is rare. The real test passes in these legs, consistent with a single CI failure. I found no duplicate open or merged PR for this test or mechanism. ### Issues Fixed No issue filed. Found during SR2 candidate validation (#40116). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…l test reopens it (#40359) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). This is a test-only fix for the SR2 candidate validation in #40116, so it targets `candidate/11.0.1xx-sr2`, like the earlier candidate test fixes. ### Description of Change On candidate head `888db82bd5`, Windows device-test build 1686840 failed `ShellTests.TabWithSeveralShellContentsOpensFromTabBarOverflowMenu` (run 47076696, result 102198) at `ShellTabBarTests.Windows.cs:276` with `The overflow menu did not open again`. That test came in with #39412. **Root cause (test timing):** 1. The test clicks "Tab 7", and later "Sub B", in the tab bar overflow menu. Both tabs select on invoke, so the click hides the menu. 2. Hiding only closes the flyout's popup. WinUI keeps the `MenuFlyout` registered as open until its presenter unloads and raises `Closed`. Until then, `ShowAt` on the same flyout and target is ignored. 3. The test waits for navigation and then reopens the menu with `ShowAt`. Navigation is usually observed after the presenter has unloaded, but not always. When it's observed first, `ShowAt` is a no-op and `IsOpen` never becomes true. **Fix:** a new helper, `ClickOverflowMenuItemThatClosesMenu`, waits for `Flyout.Closed` after the two clicks that close the menu, before the menu is reopened. The diff is +21/−2 in `ShellTabBarTests.Windows.cs` only. Assertions, messages, deadlines and test cases are unchanged. No product code changes. **Causal evidence (Helix `Windows.11.Amd64.Client.Open`, Controls device tests, Shell category):** A temporary, uncommitted probe (`OverflowProbe*`, never committed) runs alongside the real tests: - **A (trigger):** clicks "Sub B" and calls `ShowAt` at once, as when navigation is observed before the presenter unloads. - **B (trigger + fix):** the same, but clicks with this PR's helper. - **C (real test):** `TabWithSeveralShellContentsOpensFromTabBarOverflowMenu`, 20 iterations. - **D (trigger removed):** the original order, which waits for navigation before reopening. | Leg | Helper wait present | A trigger | B trigger + helper | C real test | D no trigger | Real overflow tests | | --- | --- | --- | --- | --- | --- | --- | | fix | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | reverted (r1) | no | — | — | — | — | not run: the probe edit failed to build (CS0219) | | reverted (r2) | no | red 10/10 | **red 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r1) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r2) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | Each leg's payload records `variant.json` with `fixWaitPresent` and SHA-256s of the test and probe files. - Helix jobs: `509c2c0a-230d-4310-9524-199f5d1858e9` (r1) and `c16a74fd-9a5b-4979-b7a9-22d0519b5755` (r2). - r1's reverted leg failed to compile, so r2 repeated the matrix with a corrected revert. - A shows the trigger reproduces `did not open again` every time without the wait. - B flips red when only the helper's `Closed` wait is removed, and green again when it's restored. - C and D show the original race is rare. The real test passes in these legs, consistent with a single CI failure. I found no duplicate open or merged PR for this test or mechanism. ### Issues Fixed No issue filed. Found during SR2 candidate validation (#40116). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…l test reopens it (#40359) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). This is a test-only fix for the SR2 candidate validation in #40116, so it targets `candidate/11.0.1xx-sr2`, like the earlier candidate test fixes. ### Description of Change On candidate head `888db82bd5`, Windows device-test build 1686840 failed `ShellTests.TabWithSeveralShellContentsOpensFromTabBarOverflowMenu` (run 47076696, result 102198) at `ShellTabBarTests.Windows.cs:276` with `The overflow menu did not open again`. That test came in with #39412. **Root cause (test timing):** 1. The test clicks "Tab 7", and later "Sub B", in the tab bar overflow menu. Both tabs select on invoke, so the click hides the menu. 2. Hiding only closes the flyout's popup. WinUI keeps the `MenuFlyout` registered as open until its presenter unloads and raises `Closed`. Until then, `ShowAt` on the same flyout and target is ignored. 3. The test waits for navigation and then reopens the menu with `ShowAt`. Navigation is usually observed after the presenter has unloaded, but not always. When it's observed first, `ShowAt` is a no-op and `IsOpen` never becomes true. **Fix:** a new helper, `ClickOverflowMenuItemThatClosesMenu`, waits for `Flyout.Closed` after the two clicks that close the menu, before the menu is reopened. The diff is +21/−2 in `ShellTabBarTests.Windows.cs` only. Assertions, messages, deadlines and test cases are unchanged. No product code changes. **Causal evidence (Helix `Windows.11.Amd64.Client.Open`, Controls device tests, Shell category):** A temporary, uncommitted probe (`OverflowProbe*`, never committed) runs alongside the real tests: - **A (trigger):** clicks "Sub B" and calls `ShowAt` at once, as when navigation is observed before the presenter unloads. - **B (trigger + fix):** the same, but clicks with this PR's helper. - **C (real test):** `TabWithSeveralShellContentsOpensFromTabBarOverflowMenu`, 20 iterations. - **D (trigger removed):** the original order, which waits for navigation before reopening. | Leg | Helper wait present | A trigger | B trigger + helper | C real test | D no trigger | Real overflow tests | | --- | --- | --- | --- | --- | --- | --- | | fix | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | reverted (r1) | no | — | — | — | — | not run: the probe edit failed to build (CS0219) | | reverted (r2) | no | red 10/10 | **red 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r1) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r2) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | Each leg's payload records `variant.json` with `fixWaitPresent` and SHA-256s of the test and probe files. - Helix jobs: `509c2c0a-230d-4310-9524-199f5d1858e9` (r1) and `c16a74fd-9a5b-4979-b7a9-22d0519b5755` (r2). - r1's reverted leg failed to compile, so r2 repeated the matrix with a corrected revert. - A shows the trigger reproduces `did not open again` every time without the wait. - B flips red when only the helper's `Closed` wait is removed, and green again when it's restored. - C and D show the original race is rare. The real test passes in these legs, consistent with a single CI failure. I found no duplicate open or merged PR for this test or mechanism. ### Issues Fixed No issue filed. Found during SR2 candidate validation (#40116). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…l test reopens it (#40359) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). This is a test-only fix for the SR2 candidate validation in #40116, so it targets `candidate/11.0.1xx-sr2`, like the earlier candidate test fixes. ### Description of Change On candidate head `888db82bd5`, Windows device-test build 1686840 failed `ShellTests.TabWithSeveralShellContentsOpensFromTabBarOverflowMenu` (run 47076696, result 102198) at `ShellTabBarTests.Windows.cs:276` with `The overflow menu did not open again`. That test came in with #39412. **Root cause (test timing):** 1. The test clicks "Tab 7", and later "Sub B", in the tab bar overflow menu. Both tabs select on invoke, so the click hides the menu. 2. Hiding only closes the flyout's popup. WinUI keeps the `MenuFlyout` registered as open until its presenter unloads and raises `Closed`. Until then, `ShowAt` on the same flyout and target is ignored. 3. The test waits for navigation and then reopens the menu with `ShowAt`. Navigation is usually observed after the presenter has unloaded, but not always. When it's observed first, `ShowAt` is a no-op and `IsOpen` never becomes true. **Fix:** a new helper, `ClickOverflowMenuItemThatClosesMenu`, waits for `Flyout.Closed` after the two clicks that close the menu, before the menu is reopened. The diff is +21/−2 in `ShellTabBarTests.Windows.cs` only. Assertions, messages, deadlines and test cases are unchanged. No product code changes. **Causal evidence (Helix `Windows.11.Amd64.Client.Open`, Controls device tests, Shell category):** A temporary, uncommitted probe (`OverflowProbe*`, never committed) runs alongside the real tests: - **A (trigger):** clicks "Sub B" and calls `ShowAt` at once, as when navigation is observed before the presenter unloads. - **B (trigger + fix):** the same, but clicks with this PR's helper. - **C (real test):** `TabWithSeveralShellContentsOpensFromTabBarOverflowMenu`, 20 iterations. - **D (trigger removed):** the original order, which waits for navigation before reopening. | Leg | Helper wait present | A trigger | B trigger + helper | C real test | D no trigger | Real overflow tests | | --- | --- | --- | --- | --- | --- | --- | | fix | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | reverted (r1) | no | — | — | — | — | not run: the probe edit failed to build (CS0219) | | reverted (r2) | no | red 10/10 | **red 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r1) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r2) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | Each leg's payload records `variant.json` with `fixWaitPresent` and SHA-256s of the test and probe files. - Helix jobs: `509c2c0a-230d-4310-9524-199f5d1858e9` (r1) and `c16a74fd-9a5b-4979-b7a9-22d0519b5755` (r2). - r1's reverted leg failed to compile, so r2 repeated the matrix with a corrected revert. - A shows the trigger reproduces `did not open again` every time without the wait. - B flips red when only the helper's `Closed` wait is removed, and green again when it's restored. - C and D show the original race is rare. The real test passes in these legs, consistent with a single CI failure. I found no duplicate open or merged PR for this test or mechanism. ### Issues Fixed No issue filed. Found during SR2 candidate validation (#40116). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…l test reopens it (dotnet#40359) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). This is a test-only fix for the SR2 candidate validation in dotnet#40116, so it targets `candidate/11.0.1xx-sr2`, like the earlier candidate test fixes. ### Description of Change On candidate head `888db82bd5`, Windows device-test build 1686840 failed `ShellTests.TabWithSeveralShellContentsOpensFromTabBarOverflowMenu` (run 47076696, result 102198) at `ShellTabBarTests.Windows.cs:276` with `The overflow menu did not open again`. That test came in with dotnet#39412. **Root cause (test timing):** 1. The test clicks "Tab 7", and later "Sub B", in the tab bar overflow menu. Both tabs select on invoke, so the click hides the menu. 2. Hiding only closes the flyout's popup. WinUI keeps the `MenuFlyout` registered as open until its presenter unloads and raises `Closed`. Until then, `ShowAt` on the same flyout and target is ignored. 3. The test waits for navigation and then reopens the menu with `ShowAt`. Navigation is usually observed after the presenter has unloaded, but not always. When it's observed first, `ShowAt` is a no-op and `IsOpen` never becomes true. **Fix:** a new helper, `ClickOverflowMenuItemThatClosesMenu`, waits for `Flyout.Closed` after the two clicks that close the menu, before the menu is reopened. The diff is +21/−2 in `ShellTabBarTests.Windows.cs` only. Assertions, messages, deadlines and test cases are unchanged. No product code changes. **Causal evidence (Helix `Windows.11.Amd64.Client.Open`, Controls device tests, Shell category):** A temporary, uncommitted probe (`OverflowProbe*`, never committed) runs alongside the real tests: - **A (trigger):** clicks "Sub B" and calls `ShowAt` at once, as when navigation is observed before the presenter unloads. - **B (trigger + fix):** the same, but clicks with this PR's helper. - **C (real test):** `TabWithSeveralShellContentsOpensFromTabBarOverflowMenu`, 20 iterations. - **D (trigger removed):** the original order, which waits for navigation before reopening. | Leg | Helper wait present | A trigger | B trigger + helper | C real test | D no trigger | Real overflow tests | | --- | --- | --- | --- | --- | --- | --- | | fix | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | reverted (r1) | no | — | — | — | — | not run: the probe edit failed to build (CS0219) | | reverted (r2) | no | red 10/10 | **red 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r1) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | | restored (r2) | yes | red 10/10 | **green 10/10** | green 20/20 | green 10/10 | 4/4 pass | Each leg's payload records `variant.json` with `fixWaitPresent` and SHA-256s of the test and probe files. - Helix jobs: `509c2c0a-230d-4310-9524-199f5d1858e9` (r1) and `c16a74fd-9a5b-4979-b7a9-22d0519b5755` (r2). - r1's reverted leg failed to compile, so r2 repeated the matrix with a corrected revert. - A shows the trigger reproduces `did not open again` every time without the wait. - B flips red when only the helper's `Closed` wait is removed, and green again when it's restored. - C and D show the original race is rare. The real test passes in these legs, consistent with a single CI failure. I found no duplicate open or merged PR for this test or mechanism. ### Issues Fixed No issue filed. Found during SR2 candidate validation (dotnet#40116). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…40814) <!-- copilot-assessment:v1 --> ### Agent assessment Self-reported assessment, not an independent review. Assessed revision: `192efb9613b0f7bd215e2df2902f672500667966` | Dimension | Assessment | Rationale | |---|---|---| | Change confidence | 9/10 | ↑ Windows-only fixture change preserves assertions; bounded native-event waits clean up subscriptions. Windows compilation and both packaging modes passed.<br>↓ Remaining full-pipeline checks are still running. | | Diagnosis confidence | 8/10 | ↑ Matching native PDBs resolve the E_NOINTERFACE stowed stack to the deferred overflow callback; two main crash sequences immediately follow the same overflow test, despite different in-flight tests.<br>↓ No controlled Windows revert/reapply experiment; intermittent failures cannot be ruled out by a small sample. | | Evidence fit | 8/10 | ↑ Raw logs verify 92/0/0 Shell results in both Windows Controls jobs in 1704435, plus packaged 1704388; actual first-run TRX confirms all seven targeted cases.<br>↓ Only one build has verified Shell success in both packaging modes; Catalyst Controls and maui-pr remain pending. | <!-- /copilot-assessment --> <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). This fixes the explicitly requested `main` device-test validation; it does not change servicing branches. For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change Keep the Shell overflow fixture's native window alive until WinUI's queued rendering callbacks have run. Before cleanup, wait for `CompositionTarget.Rendering`; then hide the current overflow flyout and wait for its actual `Closed` event; finally wait for rendering again before the surrounding fixture destroys the HWND and disposes the window scope. Every wait is bounded and every event is unsubscribed. No product code, assertions, test categories or test cases are removed or changed. This addresses the fixture-lifetime race rather than catching or suppressing the native exception. The change is confined to `ShellTabBarTests.Windows.cs`, which is excluded from non-Windows test builds. #### Root-cause evidence In [main device-test build 1704308](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1704308), Windows controls unpackaged log **650** records: - `17:24:25.439Z`: `Tab With Several ShellContents Is Selected Again After Leaving TabBar Overflow Menu` starts. - `17:24:25.904Z`: its native HWND is destroyed; the crash sequence records that test as passed. - `17:24:25.907Z`: `SearchHandlerFocusTracksDetachment(replaceSearchHandler: True, disconnectHandler: False)` starts. - `17:24:26.099Z`: WinUI reports `System.InvalidCastException: No such interface supported`. - The host exits **57005 / 0xDEAD**, with MTP exit **7** and 39 recovered test results. Although MTP's expected category dump was missing, **`native-process-8400.dmp` was produced**, in artifact `DeviceTests-DeviceTests_net120-26c6211d-5128-515a-41ee-d6f162d0ce5a-1`. Its SHA-256 is `a0fc48a5e78c1e04be8a805f4296707a67fa40cfbd713d5c7b9fdda9124dc321`. The category `crash.sequence.log` has no exception stack. The dump's stowed **0x80004002 / E_NOINTERFACE** backtrace, resolved against its matching Microsoft public PDBs, includes: ```text Microsoft.UI.Xaml.Controls!winrt::check_hresult Microsoft.UI.Xaml.Controls!winrt::impl::call_factory<...FlyoutBase...GetAttachedFlyout...> Microsoft.UI.Xaml.Controls!winrt::Microsoft::UI::Xaml::Controls::Primitives::FlyoutBase::GetAttachedFlyout Microsoft.UI.Xaml.Controls!NavigationViewItem::ShowHideChildren::<lambda>::operator() Microsoft.UI.Xaml.Controls!SharedHelpers::QueueCallbackForCompositionRendering::<lambda>::Invoke Microsoft.UI.Xaml!CEventSourceBase::Raise Microsoft.UI.Xaml!DXamlCore::OnRenderingEvent Microsoft.UI.Xaml!CCoreServices::CallPerFrameCallback ``` The native callback is queued by expanding a nested navigation item. The preceding overflow test invokes the item, observes synchronous Shell selection, and returns without waiting for that callback. Its old window is therefore already destroyed when WinUI runs the deferred flyout lookup during the next test. SearchHandler is the in-flight test, not the operation identified by the originating native stack. **Independent corroboration:** [main build 1704369](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1704369), at the PR's base `9c4919b856`, crashed in Windows controls packaged log **808** with `Can Reuse Pages` in flight. Its real crash sequence shows the same overflow test passed at `18:09:54.280Z`, then `Can Reuse Pages` started at `18:09:54.295Z`. The crash moves between later tests, but both sequences immediately follow the same overflow fixture. This is distinct from merged #40805's empty-overlay/Win2D `0x80070490` path and merged #40802's NavigationPage completion callback; neither is modified. The fix in #40359 waits for flyout closure **before reopening** it; this adds the missing rendering/closure barriers **before destroying the overflow fixture**. Open and recently merged PRs were searched across main, net11, candidate, inflight and release branches; no equivalent teardown fix was found. #### Validation - `../kubaflo-catalyst-cascade/.dotnet/dotnet format whitespace --folder --include src/Controls/tests/DeviceTests/Elements/Shell/ShellTabBarTests.Windows.cs --verify-no-changes` — **passed**. - `git diff --check` — **passed** before committing. - Windows tests cannot run on this macOS host; the following results were verified in actual PR CI logs, not inferred from check badges. | Build | Windows Controls | Shell passed/failed/skipped | Raw log | |---|---|---|---| | [1704388](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1704388) | Packaged | **92 / 0 / 0** | 747 | | [1704435](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1704435) | Unpackaged | **92 / 0 / 0** | 747 | | [1704435](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1704435) | Packaged | **92 / 0 / 0** | 754 | Both builds used merge revision `e9a4c5e4975a961d0273c3241ab74b54e7279dfa`, containing the assessed head. Each whole Shell category includes all four overflow tests and all three `SearchHandlerFocusTracksDetachment` variants. The actual 1704388 packaged `Controls-Shell.trx` was also checked and confirms those seven tests passed. 1704388's unpackaged job stalled; the requested Azure rerun automatically superseded/deleted that active build. Its packaged evidence was downloaded and verified before supersession. **No unpackaged success is claimed for 1704388.** One build has verified complete Shell success in both Windows jobs, with an additional independent packaged pass. This is encouraging evidence for an intermittent crash, not proof that it can never recur. **Other platforms:** Raw native execution logs in 1704435 report zero failures for all five Android suites, all completed iOS suites/shards (including Shell), and Catalyst Core, Graphics, Essentials and BlazorWebView. The changed file does not compile for those platforms. Catalyst Controls is still running. The first run's Catalyst Controls reported two failures in SwipeView and CollectionView; these are outside this Windows-only change, but an identical baseline failure was not established, so they are not claimed as verified known flakes. **Remaining checks:** `maui-pr` build [1704389](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1704389) and 1704435 Catalyst Controls are still running. No full-pipeline green or merge-readiness claim is made. A second completed build with both Windows Shell jobs passing would strengthen the evidence; another rerun must wait until the current build finishes to avoid Azure superseding it. ### Issues Fixed <!-- Please make sure that there is a bug logged for the issue being fixed. The bug should describe the problem and how to reproduce it. --> No separate issue filed. Investigated from recurring main CI host crashes in builds 1704308 and 1704369, after #40805. ### Let AI finish this PR - [ ] **Let the MAUI agent address review feedback and fix remaining issues on this PR.** Maintainers still decide whether it is merged. For PRs from forks, the agent opens a follow-up PR that keeps your commits. <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Target Branch
mainnet11, for reviewThis is a test-only fix for the SR2 candidate validation in #40116, so it targets
candidate/11.0.1xx-sr2, like the earlier candidate test fixes.Description of Change
On candidate head
888db82bd5, Windows device-test build 1686840 failedShellTests.TabWithSeveralShellContentsOpensFromTabBarOverflowMenu(run 47076696, result 102198) atShellTabBarTests.Windows.cs:276withThe overflow menu did not open again. That test came in with #39412.Root cause (test timing):
MenuFlyoutregistered as open until its presenter unloads and raisesClosed. Until then,ShowAton the same flyout and target is ignored.ShowAt. Navigation is usually observed after the presenter has unloaded, but not always. When it's observed first,ShowAtis a no-op andIsOpennever becomes true.Fix: a new helper,
ClickOverflowMenuItemThatClosesMenu, waits forFlyout.Closedafter the two clicks that close the menu, before the menu is reopened. The diff is +21/−2 inShellTabBarTests.Windows.csonly. Assertions, messages, deadlines and test cases are unchanged. No product code changes.Causal evidence (Helix
Windows.11.Amd64.Client.Open, Controls device tests, Shell category):A temporary, uncommitted probe (
OverflowProbe*, never committed) runs alongside the real tests:ShowAtat once, as when navigation is observed before the presenter unloads.TabWithSeveralShellContentsOpensFromTabBarOverflowMenu, 20 iterations.Each leg's payload records
variant.jsonwithfixWaitPresentand SHA-256s of the test and probe files.509c2c0a-230d-4310-9524-199f5d1858e9(r1) andc16a74fd-9a5b-4979-b7a9-22d0519b5755(r2).did not open againevery time without the wait.Closedwait is removed, and green again when it's restored.I found no duplicate open or merged PR for this test or mechanism.
Issues Fixed
No issue filed. Found during SR2 candidate validation (#40116).