Flaky test: ComboBoxIntegrationTests::CanCycleThroughItemsWithMouseWheel

Author: JesseColCreated Aug 18, 2026Updated Sep 18, 2026
Labelsbugarea-TestInfrastructurearea-ComboBoxteam-Controls

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

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

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.

Source: microsoft/microsoft-ui-xaml