unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
9.08k stars 736 forks source link

`MediaPlayer` tests are failing too often #13384

Open jeromelaban opened 1 year ago

jeromelaban commented 1 year ago

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

jeromelaban commented 1 year ago

@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()