[ci-scan] Recurring: BottomSheetDetentHeightIsCorrectWhenCollectionViewIsMeasuredBeforeMount crashes on iOS in maui-pr-uitests
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 290
Description
## Summary
`BottomSheetDetentHeightIsCorrectWhenCollectionViewIsMeasuredBeforeMount` causes the iOS test host app to crash in the `Controls (vlatest)` UI test leg, appearing in at least 2 of the last 10 builds.
## Build Information
- **Pipeline**: maui-pr-uitests (definition 313)
- **Build**: [1486368](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1486368)
- **Build ID**: 1486368
- **Branch**: main
- **First seen**: 2026-06-23 (build 1476735)
- **Occurrences**: 2 in last 10 builds (1476735 on 2026-06-23, 1486368 on 2026-06-29)
## Affected Legs
- iOS UITests Mono — `Controls (vlatest)` task (iOS latest simulator)
- Both first run and retry fail with the same crash
## Error Message
```
Failed BottomSheetDetentHeightIsCorrectWhenCollectionViewIsMeasuredBeforeMount [20 s]
Error Message:
The app was expected to be running still, investigate as possible crash
TearDown : The app was expected to be running still, investigate as possible crash
Stack Trace:
at UITest.Appium.NUnit.UITestBase.UITestBaseTearDown() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 159
at UITest.Appium.NUnit.UITestBase.TestTearDown() in /_/src/TestUtils/src/UITest.NUnit/UITestBase.cs:line 45
```
## Recommended Action
1. Locate `BottomSheetDetentHeightIsCorrectWhenCollectionViewIsMeasuredBeforeMount` in `src/Controls/tests/TestCases.Shared.Tests/`.
2. The test verifies detent height of a bottom sheet containing a `CollectionView` measured before the sheet is mounted. An app crash during or after this test suggests a native iOS exception in the BottomSheet or CollectionView measurement path.
3. Check for recent changes to `BottomSheet` presentation on iOS (`src/Controls/src/Core/`) or `CollectionView` iOS handler (`src/Controls/src/Core/Handlers/Items/iOS/`).
4. Run with crash logs: look for `EXC_BAD_ACCESS` or unhandled `NSException` in the simulator's crash reporter during the test run.
5. Verify whether the crash is triggered by the measurement pre-mount path specifically (the test name suggests a race between `CollectionView.Measure()` and the sheet's `Mount`/`Present` lifecycle).
> Generated by [CI Failure Scanner](https://github.com/dotnet/maui/actions/runs/28487306186) · 3.6K AIC · ⌖ 14.6 AIC · ⊞ 36.2K · [◷](https://github.com/search?q=repo%3Adotnet%2Fmaui+is%3Aissue+%22gh-aw-workflow-call-id%3A+dotnet%2Fmaui%2Fci-status-main%22&type=issues)
Contributor guide
Research direction
Start with BottomSheetDetentHeightIsCorrectWhenCollectionViewIsMeasuredBeforeMount in src/Controls/tests/TestCases.Shared.Tests/, then inspect BottomSheet presentation in src/Controls/src/Core/ and the CollectionView iOS handler in src/Controls/src/Core/Handlers/Items/iOS/. Run the iOS Controls (vlatest) UI test with simulator crash logs and check whether the pre-mount measurement path produces an EXC_BAD_ACCESS or NSException; done means the test completes without the app crashing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, ios
- Domain
- mobile-dev, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100