Skip to content

MediaPlayer tests are failing too often #13384

Open

Description

@jeromelaban

Current behavior

When_MediaPlayerElement_AutoPlay_Source
When_MediaPlayerElement_NotAutoPlay_Source
When_MediaPlayerElement_SetIsFullWindow_Check_Fullscreen
When_MediaPlayerElement_SetSource_Check_PlayStop

It is likely caused by the URL that may not always be available. Let's use uno assets site instead (maybe with a version of the file that is smaller than 5MB).

---
	Details:
Failed: When_MediaPlayerElement_AutoPlay_Source() [Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException] 
 Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Timed out waiting for condition to be met. Windows.UI.Xaml.Controls.MediaPlayerElement loaded
   at Private.Infrastructure.TestServices.WindowHelper.WaitFor(Func`1 condition, Int32 timeoutMS, String message, String callerMemberName, Int32 lineNumber)
   at Private.Infrastructure.TestServices.WindowHelper.<>c__DisplayClass33_0.<<WaitForLoaded>g__Do|0>d.MoveNext()
--- End of stack trace from previous location ---
   at Private.Infrastructure.TestServices.WindowHelper.WaitForLoaded(FrameworkElement element, Int32 timeoutMS)
   at Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls.Given_MediaPlayerElement.When_MediaPlayerElement_AutoPlay_Source()
   at Uno.UI.Samples.Tests.UnitTestsControl.<>c__DisplayClass63_1.<<ExecuteTestsForInstance>g__InvokeTestMethod|2>d.MoveNext()

Failed: When_MediaPlayerElement_NotAutoPlay_Source() [Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException] 
 Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Timed out waiting for condition to be met. Windows.UI.Xaml.Controls.MediaPlayerElement loaded
   at Private.Infrastructure.TestServices.WindowHelper.WaitFor(Func`1 condition, Int32 timeoutMS, String message, String callerMemberName, Int32 lineNumber)
   at Private.Infrastructure.TestServices.WindowHelper.<>c__DisplayClass33_0.<<WaitForLoaded>g__Do|0>d.MoveNext()
--- End of stack trace from previous location ---
   at Private.Infrastructure.TestServices.WindowHelper.WaitForLoaded(FrameworkElement element, Int32 timeoutMS)
   at Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls.Given_MediaPlayerElement.When_MediaPlayerElement_NotAutoPlay_Source()
   at Uno.UI.Samples.Tests.UnitTestsControl.<>c__DisplayClass63_1.<<ExecuteTestsForInstance>g__InvokeTestMethod|2>d.MoveNext()

Failed: When_MediaPlayerElement_SetIsFullWindow_Check_Fullscreen() [Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException] 
 Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Timed out waiting for condition to be met. Windows.UI.Xaml.Controls.MediaPlayerElement loaded
   at Private.Infrastructure.TestServices.WindowHelper.WaitFor(Func`1 condition, Int32 timeoutMS, String message, String callerMemberName, Int32 lineNumber)
   at Private.Infrastructure.TestServices.WindowHelper.<>c__DisplayClass33_0.<<WaitForLoaded>g__Do|0>d.MoveNext()
--- End of stack trace from previous location ---
   at Private.Infrastructure.TestServices.WindowHelper.WaitForLoaded(FrameworkElement element, Int32 timeoutMS)
   at Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls.Given_MediaPlayerElement.When_MediaPlayerElement_SetIsFullWindow_Check_Fullscreen()
   at Uno.UI.Samples.Tests.UnitTestsControl.<>c__DisplayClass63_1.<<ExecuteTestsForInstance>g__InvokeTestMethod|2>d.MoveNext()

Failed: When_MediaPlayerElement_SetSource_Check_PlayStop() [Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException] 
 Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Timed out waiting for condition to be met. Windows.UI.Xaml.Controls.MediaPlayerElement loaded
   at Private.Infrastructure.TestServices.WindowHelper.WaitFor(Func`1 condition, Int32 timeoutMS, String message, String callerMemberName, Int32 lineNumber)
   at Private.Infrastructure.TestServices.WindowHelper.<>c__DisplayClass33_0.<<WaitForLoaded>g__Do|0>d.MoveNext()
--- End of stack trace from previous location ---
   at Private.Infrastructure.TestServices.WindowHelper.WaitForLoaded(FrameworkElement element, Int32 timeoutMS)
   at Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Contr

Expected behavior

No failure.

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

No response

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

Activity

  1. added
    kind/bug
    area/tests 🧪
    project/media 📺
    difficulty/tbd
    on Aug 24, 2023
  2. jeromelaban commented on Aug 31, 2023

    @jeromelaban
    MemberAuthor

    @rafael-rosa-knowcode I'm also adding When_MediaPlayerElement_SetIsFullWindow_Check_Fullscreen for android, which fails this way:

    Microsoft.VisualStudio.TestTools.UnitTesting.AssertFailedException: Timed out waiting for condition to be met. Windows.UI.Xaml.Controls.MediaPlayerElement loaded
       at Private.Infrastructure.TestServices.WindowHelper.WaitFor(Func`1 condition, Int32 timeoutMS, String message, String callerMemberName, Int32 lineNumber)
       at Private.Infrastructure.TestServices.WindowHelper.<>c__DisplayClass33_0.<<WaitForLoaded>g__Do|0>d.MoveNext()
    --- End of stack trace from previous location ---
       at Private.Infrastructure.TestServices.WindowHelper.WaitForLoaded(FrameworkElement element, Int32 timeoutMS)
       at Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls.Given_MediaPlayerElement.When_MediaPlayerElement_SetIsFullWindow_Check_Fullscreen()
       at Uno.UI.Samples.Tests.UnitTestsControl.<>c__DisplayClass63_1.<<ExecuteTestsForInstance>g__InvokeTestMethod|2>d.MoveNext()
    
  3. changed the title [-]MediaPlayer tests are failing too often[/-] [+]`MediaPlayer` tests are failing too often[/+] on Oct 23, 2023
  4. added
    difficulty/starter 🚀
    and removed
    difficulty/tbd
    on Oct 23, 2023
  5. github-actions commented on Aug 12, 2025

    @github-actions
    Contributor

    Hey there — just a heads-up that this issue has been quiet for over a year. If there’s no update or comment in the next 10 days, it’ll be closed automatically. Feel free to remove the stale label or drop a note to keep it open.

  6. added
    stale
    on Aug 12, 2025
  7. MartinZikmund commented on Aug 12, 2025

    @MartinZikmund
    Member

    Still relevant

  8. removed
    stale
    on Aug 12, 2025
  9. MartinZikmund commented on Apr 13, 2026

    @MartinZikmund
    Member

    Repro generator

    This issue was classified as not reproducible with a separate code sample or test.

    Reason: The four referenced tests (When_MediaPlayerElement_AutoPlay_Source, _NotAutoPlay_Source, _SetIsFullWindow_Check_Fullscreen, _SetSource_Check_PlayStop) already exist in src/Uno.UI.RuntimeTests. The bug is CI-only flakiness driven by the external test video URL availability and download time, not a defect in product code or a missing repro. Resolution is a flakiness fix on the existing tests (e.g. switch to a small Uno-hosted asset).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/tests 🧪difficulty/starter 🚀kind/bugno-reproproject/media 📺

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions