Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MediaPlayer tests are failing too often #13412

Closed
wants to merge 1 commit into from

Conversation

rafael-rosa-knowcode
Copy link
Contributor

@rafael-rosa-knowcode rafael-rosa-knowcode commented Aug 25, 2023

GitHub Issue (If applicable): closes #13384

PR Type

What kind of change does this PR introduce?

  • Refactoring (no functional changes, no api changes)

What is the 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

What is the new behavior?

Runs from a URL from uno-assets

Copilot Summary

🤖 Generated by Copilot at f60f165

Enabled and fixed some media player element tests in Given_MediaPlayerElement.cs. Updated the test video URL to improve reliability.

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@rafael-rosa-knowcode
Copy link
Contributor Author

How can I access the list of videos within https://uno-assets.platform.uno/tests/videos?

I am aware of this Getting_Started_with_Uno_Platform_and_Visual_Studio_Code.mp4
which is 6.6MB.
For now I put this one, but I would need some guidance on how to upload another video or the link of an existing one.

In case of need, this meets the requirements of 5MB.
https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/720/Big_Buck_Bunny_720_10s_5MB.mp4

Tests.
image

@@ -24,10 +24,9 @@ namespace Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml_Controls;
[RunsOnUIThread]
public partial class Given_MediaPlayerElement
{
private static readonly Uri TestVideoUrl = new Uri("https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/720/Big_Buck_Bunny_720_10s_5MB.mp4");
private static readonly Uri TestVideoUrl = new Uri("https://uno-assets.platform.uno/tests/videos/Getting_Started_with_Uno_Platform_and_Visual_Studio_Code.mp4");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests still fail in CI.

image

@jeromelaban jeromelaban marked this pull request as draft October 20, 2023 03:30
Copy link

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or it will be closed in 10 days.

@github-actions github-actions bot added the stale This item has been marked as stale and will be closed if there is no activity. label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This item has been marked as stale and will be closed if there is no activity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MediaPlayer tests are failing too often
4 participants