Skip to content

Flaky DirectManipulation inertia tests on Skia runtime #22702

@MartinZikmund

Description

@MartinZikmund

Current behavior

Two runtime tests in Given_InputManager.cs are flaky on the Skia runtime and are currently disabled with [Ignore]:

  • When_DirectManipulationMultipleWithInertia_Then_RunsIndependently
  • When_DirectManipulationMultipleWithMultipleInertia_Then_RunsIndependently

Both tests verify that ScrollViewer inertia continues running independently when a second ScrollViewer is interacted with.

Root cause

The tests use await UITestHelper.WaitForRender() (waits for 1 rendering frame) then assert that inertia has advanced the scroll offset. This is a race condition: the test's CompositionTarget.Rendering handler can resolve before the inertia processor's Rendering handler fires on the same frame, so the scroll offset hasn't been updated yet.

Additionally, even waiting for multiple frames is insufficient — inertia can complete entirely between offset captures, causing the "still running" assertions to fail (observed with WaitForRender(frameCount: 2) where the offset was 12699.99 and didn't change).

Suggested investigation

  • Determine how long inertia is expected to last for the test's drag parameters (200px, 1 step, 20ms offset)
  • Consider whether the test should use longer/slower drags to ensure inertia lasts long enough for multiple assertions
  • Consider restructuring assertions to not depend on inertia still being active at a specific point in time
  • Investigate whether WaitFor condition-based polling can work if the drag parameters are tuned to produce longer-lasting inertia

File

src/Uno.UI.RuntimeTests/Tests/Uno_UI_Xaml_Core/Given_InputManager.cs

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions