microsoft / microsoft/microsoft-ui-xaml

Flaky test: ComboBoxIntegrationTests::CanCycleThroughItemsWithMouseWheel

Open
#11,541 0 comments 0 reactions 1 assignee Claimed by @JesseCol View on GitHub
area-ComboBox area-TestInfrastructure bug team-Controls
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

## Summary

`ComboBoxIntegrationTests::CanCycleThroughItemsWithMouseWheel` is flaky because synthetic mouse-wheel input intermittently does not update `SelectedIndex`. The failure can block PR and nightly validation.

## Test

Source: [`ComboBoxIntegrationTests.cpp`](https://github.com/microsoft/microsoft-ui-xaml/blob/6112d936461edb6d81ce7db983c74cc60ea2bc28/dxaml/test/native/external/controls/combobox/ComboBoxIntegrationTests.cpp#L1201-L1232)

The test focuses a `ComboBox` and expects three mouse-wheel inputs to move selection:

1. `-1` to `0`
2. `0` to `1`
3. `1` to `0`

## Observed failures

```text
AreEqual(expected, selector->SelectedIndex) - Values (0, -1)
AreEqual(expected, selector->SelectedIndex) - Values (1, 0)
```

The assertions are reported from `dxaml/test/native/external/controls/inc/SelectorHelper.h`, line 21. In a recent run, the failure reproduced on two machines:

- 8 of 11 in-job attempts failed on one machine.
- 7 of 11 in-job attempts failed on another machine.

Historical PR-pipeline results also show failures during the preceding 30 days.

## Expected behavior

Each injected wheel input should be observed, and the test should pass reliably under repeated execution on every configuration where it is enabled.

## Notes

- A `SetForegroundWindow` warning sometimes accompanies the failure, but the failing condition is the unchanged selection.
- The test directly adds `ComboBoxItem` instances. It does not set an `ItemTemplate` or call `DataTemplate.LoadContent()`.
- Targeted validation that forced `DataTemplate::LoadContentImpl()` to fail did not affect this test. A prior timing correlation with an unrelated DataTemplate change therefore does not establish causation.

## Completion criteria

- Identify why mouse-wheel input is intermittently dropped or not observed.
- Make the test deterministic without weakening its three selection-transition checks.
- Confirm sustained passes under repeated execution on the affected configurations.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.