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
8.81k stars 708 forks source link

[Epic] Flaky tests roundup #9080

Open MartinZikmund opened 2 years ago

MartinZikmund commented 2 years ago

Current behavior

This epic tracks flaky tests so they can be addressed one by one.

When a flaky test is added in this list, it can be set to [Ignore] on the platform or platforms where it tends to fail.

In Progress

Done

Youssef1313 commented 2 years ago

When_Reorder_To_Last_2 on WASM, Android

This test appears to be Wasm only. I'm disabling in https://github.com/unoplatform/uno/pull/9571

jeromelaban commented 1 year ago

Images for When_Transforms_Paused_With_FillBehaviorStop_Then_Hold:

Teardown: When_Transforms_Paused_With_FillBehaviorStop_Then_Hold_When_Transforms_Paused_With_FillBehaviorStop_Then_Hold_-_Tear_down_on_error Initial: When_Transforms_Paused_With_FillBehaviorStop_Then_Hold_Initial Final: When_Transforms_Paused_With_FillBehaviorStop_Then_Hold_Final

ramezgerges commented 1 year ago

When_UsingMultipleLanguages is acting really off. First off, CultureInfo returns weird patterns e.g. in ft-CA, info.LongTimePattern returns HH 'h' mm instead of HH:mm. A possible hack is to replace the added garbage with a colon e.g. using Regex.Replace(value, " '[^']*' ", ":"), but obviously, that isn't ideal. Another thing is that our DateTimeFormatter implementation diverges a lot from the net7 implementation, so it might need a rewrite or something.

ramezgerges commented 1 year ago

VerifyFocusedItemIsRecycledOnCollectionReset seems to fail on skia due to a problem with dispatching measure/arrange. Items in an ItemsRepeater are only updated in a Measure, and it appears that no Measure is dispatched during the test (even though some paths are dirty for sure). A manual GetRoot(repeater).Measure(Window.Current.Bounds.Size) (where GetRoot just walks up the tree to get the RootVisual) passes the test, but I've failed to find the root of the problem.

Edit: It appears that TestServices.WindowHelper.WaitForIdle().Wait() is causing a deadlock (usually it's called with await instead of Wait()).

Youssef1313 commented 1 year ago

I took a look at When_EmbeddedResource, I think the problem is related to shared projects.

image

The TargetPath here is SharedProjectEmbeddedFile.txt instead of Embedded/SubFolder1/SubFolder2/SharedProjectEmbeddedFile.txt.

Youssef1313 commented 1 year ago

AssignLinkMetadata is somehow capable of determining the Link correctly. It should have run before AssignTargetPath.

We already have code for that, but it is racing with code in msbuild.

https://github.com/unoplatform/uno/blob/d1d468f240672e6ce8a2d06ad44db60c1b466fd3/src/SourceGenerators/Uno.UI.Tasks/Content/Uno.UI.Tasks.targets#L33-L40

https://github.com/dotnet/msbuild/blob/69a09e4d0ad2a26fab4100e78585c85bc2f9f5a7/src/Tasks/Microsoft.Common.CurrentVersion.targets#L3098-L3100

image

The evaluation from Uno.UI.Tasks.targets was done first (because it's imported first), then it got cleared by msbuild code from Microsoft.Common.CurrentVersion.targets