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

[Epic] Flaky tests roundup #9080

Open
MartinZikmund opened this issue Jun 20, 2022 · 6 comments
Open

[Epic] Flaky tests roundup #9080

MartinZikmund opened this issue Jun 20, 2022 · 6 comments
Labels
area/tests 🧪 Categorizes an issue or PR as relevant to tests difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding epic kind/bug Something isn't working

Comments

@MartinZikmund
Copy link
Member

MartinZikmund commented Jun 20, 2022

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.

  • When_Large_List_Scroll_To_End_Then_Back_Up_And_First_Item is flaky in WASM CI
  • ValidateDynamicOverflowOrderBasic() is flaky on Android #19585
  • When_ShapeVisual_ViewBox_Shape_Combinations (When_ShapeVisual_ViewBox_Shape_Combinations is unstable #18752)
  • When_Rectangle UI test is very flaky on iOS
  • BreadcrumbBar leak tests are flaky on iOS
  • Given_AppWindow.WhenResize is failing in CI on Linux, passing locally
  • [Android] Knob_Translation fails in CI #18375
  • ListView tests on iOS crash on 17.0+ simulators #17101
  • [iOS] When_Setting_SelectedItem_TakesEffect NSInternalInconsistencyException Reason: Attempted to scroll the collection view to an out-of-bounds item #17102
  • ValidateElementsHaveCorrectKeys is not passing (incorrectly disabled)
  • VerifyKeyboardAcceleratorCanOverrideControlAccelerator, VerifyTryInvokeKeyboardAcceleratorBehaviorForLocallyScopedAccelerator, ValidateKeyboardAcceleratorEventNotInvokedWhenCollapsed and ValidateKeyboardAcceleratorBehaviorWithMultipleModifiers on Skia are unstable
  • When_Image_Is_Monochromatic fails on iOS .NET 9 RC1
  • Runtime test content alignment is not consistent #18064
  • Some Given_ImageBrush.WhenStretch fail on iOS
  • GridViewGroupedResizable is too slow and fails randomly test: Move GridViewGroupedResizable to manual test #18926
  • Pointer tests are not passing on wasm #17742
  • When_Hungarian_Culture_Column_Order, When_Czech_Culture_Column_Order and When_CanadaFrench_Culture_Column_Order fail on net9 wasm. It could be related to a missing/filtered ICU, or a headless browser issue, it works locally.
  • MoveItemsBetweenPrimaryAndSecondaryCommands is unstable on android
  • When_DownSampling is flaky and disabled in test: Disable flaky test #16991
    Running test When_DownSampling()
    GLIB UNHANDLED EXCEPTIONSystem.ArgumentNullException: Value cannot be null. (Parameter 'bitmap')
       at SkiaSharp.SKImage.FromBitmap(SKBitmap bitmap)
       at Windows.UI.Composition.CompositionSurfaceBrush.UpdatePaint(SKPaint fillPaint, SKRect bounds) in C:\a\1\s\src\Uno.UI.Composition\Composition\CompositionSurfaceBrush.skia.cs:line 91
       at Windows.UI.Composition.CompositionSpriteShape.Paint(PaintingSession& session) in C:\a\1\s\src\Uno.UI.Composition\Composition\CompositionSpriteShape.skia.cs:line 19
       at Windows.UI.Composition.BorderVisual.Paint(PaintingSession& session) in C:\a\1\s\src\Uno.UI.Composition\Composition\BorderVisual.skia.cs:line 127
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 190
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.Render(PaintingSession& parentSession) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 199
       at Windows.UI.Composition.Visual.RenderRootVisual(SKSurface surface, Nullable`1 offsetOverride) in C:\a\1\s\src\Uno.UI.Composition\Composition\Visual.skia.cs:line 152
       at Uno.UI.Runtime.Skia.Gtk.SoftwareRenderSurface.OnDrawn(Context cr) in C:\a\1\s\src\Uno.UI.Runtime.Skia.Gtk\Rendering\SoftwareRenderSurface.cs:line 99
       at Gtk.Widget.Drawn_cb(IntPtr inst, IntPtr cr)
    
  • SelectingTimeSetsSelectedTime is flaky on Wasm #16167
  • Tests failing under fluent #18105
  • When_UnloadAndReload_Then_ReMaterializeItems
  • When_ThemeChange on Wasm
    image
  • Android TestProgressRing_InitialState fails
  • FlyoutTest_Unloaded
  • FlyoutTest_Target is flaky on iOS
  • Given_CalendarDatePicker.When_Theme_Changes is flaky on iOS #13417
  • PasswordBox_RevealInScrollViewer is flaky on iOS
  • EventSequence_Tests.TestHyperlink misses a click event on android #15734
  • TextBox_VerticalAlignment is flaky on Wasm
  • Verify_MenuBarItem_Bounds_Native_Popups is flaky on Android - started being flaky after pull request fix(flyout): dismiss all flyouts on window focus lost and SizeChanged #13630 (@ramezgerges)
  • TextBox_Readonly is flaky on iOS
  • When_Drag_Then_DoesNotScroll is not working on Android, the thumb drags when it should not
  • CanChangeDisplayModeBeforeLoaded is flaky on Skia
  • Holding_Tests.When_InListViewWithoutItemClick fails for missing item on android
  • Holding_Tests.When_Basic fails on android
  • Holding_Tests.When_InScroll fails on android
  • Holding_Tests.When_InListViewWithItemClick fails on android
  • TestTextBoxReleaseOutFocused is flaky on WASM
  • Check_ListView_Swallows_Measure is flaky on Android #15829
  • When_MultipleItems is not failing sometimes (Timing related ?)
  • Flyout_TemplatedParent is flaky on WASM
  • WebView tests are flaky on iOS #15828
  • When_MediaPlayerElement_SetSource_Check_Play fails on Skia #15471
  • TestTranslatedTap is flaky on WASM (could be related to TestTranslatedClick fails on faster build agents #13844)
  • ValidateOverflowPlacement does not pass on Android
  • TestTranslatedTap is failing on android
  • DoesNotShowMenuIfSecondaryElementsAreCollapsed does not pass on Android
  • When_NestedInSVAndOutOfViewportOnInitialLoad_Then_MaterializedEvenWhenScrollingOnMinorAxis is flaky on WASM
  • TestTranslatedClick fails on faster build agents #13844
  • Android When_NestedIRSlowlyChangeViewport_Then_MaterializedNeededItems (Timeout even with retries) (Youssef: Can't repro)
  • Android When_Verify_Canvas_With_Outer_Clip (Assert.Fail failed. ImageAssert.HasColorAt @ line 73) (Youssef: Verified - it always fails)
  • UITests.Windows_UI_Xaml_Media.GradientBrushTests.GradientsPage crashes the android emulator completely (not just the app)
  • Android VerifyNavigationViewItemToolTipPaneDisplayMode (Youssef: Verified - it always crashes locally)
  • When_Focused_Element_Transformed is crashing the iOS/Android emulator
  • Android VerifyCollectionChangeGetsRespected (Cleanup System.Exception: Event was not raised. in MUXApiTestBase.Cleanup()) (Youssef: test not disabled on master, and always passes for me)
  • ListView_ObservableCollection_Unused_Space fails regularly on iOS (Expected: 132.0f But was: 88.0f)
  • When_Open_Close_Root_Twice_Keep_State fails on android for missing TreeView items (Youssef: fails locally with null ref)
  • When_UsingMultipleLanguages unit test fails when running with net7 or later (DateFormatter is buggy and CultureInfo itself returns wrong values)
  • ExecuteScriptAsync tests are flaky on iOS #11997
  • NavigationViewInfoBadgeTestPage causes CI not to pass #13257
  • When_Grid_RowCollection_Changes fails with invalid child.SizePassedToArrangeOverride
  • iOS 16+ tests
    • NativeCommandBar_Size fails (The first orientation change fails to be applied)
    • ListView_SelectedItems fails (Timeout ?)
    • When_Flipview_DataTemplateSelector (AssertFailedException: Assert.Fail failed. ImageAssert.HasColorAt @ line 101)
    • When_Add_Remove failure: ColorPicker
    • When_Add_Remove failure: CalendarView
  • iOS When_ItemsControl.When_NestedItemsControl_RecycleTemplate (Assert.AreEqual failed. Expected a difference no greater than <1> between expected value <50> and actual value <0>. )
  • iOS RepeaterTests.VerifyCorrectionsInNonScrollableDirection
  • iOS/Skia VerifyFocusedItemIsRecycledOnCollectionReset (Skia fixed in test: enable working tests and add ItemsRepeater fixes for RepeaterTests #13074)
  • iOS When_WebMessageReceived (Timed out waiting for condition to be met. When_WebMessageReceived():207)
  • iOS When_Flipview_Items_Modified (Timed out waiting for equality condition to be met. Expected -1 but last received value was 0.)
  • iOS When_Render_Border_GetPixelsAsync (Assert.AreEqual failed. Expected:<<10, 10>>. Actual:<<10.5, 10>>. Invalid Layouted.)
  • test: TextBox_Readonly, PasswordBox_RevealInScrollViewer and FlyoutTest_Target are very flaky on iOS #13095
  • [All platforms] ValidateFractionalWidthDoesNotCrash (Assert.Fail failed. Timeout waiting on SpectrumRectangle.Fill to be set.) (Youssef: Test is actually skipped in WinUI. There is not much info on why it's skipped there, but I don't see anything that should trigger property changed for Fill)
  • When_StretchAndAlignment on Android 28 (Youssef: Passing for me locally)
  • TextBox_Readonly_ShouldNotBringUpKeyboard on Android 30 (The keyboard does not show up on emulators, breaking the test)
  • When_PressOnContainerAndReleaseOnNested_Mouse on WASM (fails in CI)
  • When_RepeatDuration: It was enabled in chore: enable When_RepeatDuration on skia #13060, but then failures are found and reverted in Revert "chore: enable When_RepeatDuration on skia" #13089
  • MediaPlayer tests are failing too often #13384
  • [iOS/Skia/macOS] RepeaterTests.VerifyRepeaterDoesNotLeakItemContainers (Skia started failing in build: Move build to net8.0/net9.0 instead of net8.0/net7.0 #16523)

In Progress

  • TestTextBoxReleaseOutFocused is flaky on WASM
  • TestTextBoxTap is very flaky on WASM
  • Given_SymbolIcon.Validate_Size fails on all targets (Expected:<20>. Actual:<627.5>) (fix: Fix Given_SymbolIcon.Validate_Size test failure #13069)
  • Android VerifyDropdownItemTemplateWithNoControl (failed cleanup System.Exception: Event was not raised.) (Youssef: passing for me - test: Enable skipped BreadcrumbTests on Android #13077)
  • Android VerifyBreadcrumbDefaultAPIValues (failed cleanup System.Exception: Event was not raised.) (Youssef: passing for me - test: Enable skipped BreadcrumbTests on Android #13077)
  • ValidateOverflowButtonHidesWhenAppropriateWithNoAppBarButtons, ValidateMoreButtonCanShowWithoutSizeChanging, ValidateOverflowButtonHidesWhenAppropriateWithPrimaryAppBarButtons are failing randomly on android. (Youssef: passing for me - test: Enable CommandBar tests on Android #13078)
  • Android/iOS When_EmbeddedResource (resource is not included when build on dotnet build) (Youssef: This appears to only be an issue for Uno.UI solution, ie, not a problem for external customers. Fixing in build: Make sure AssignTargetPathsDependsOn is set properly in Uno solution build #13079)
  • DoubleAnimation_Tests on android. These tests fail on android when running one by one, but don't when run with others. (Youssef: Can't repro. Enabling in test: Enable DoubleAnimation_Tests #13082)
    System.Exception : Error while performing WaitFor([unknown], "Failed to find [Completed] on [Text]", null, null, null)
    ----> System.TimeoutException : Failed to find [Completed] on [Text]
    
  • When_Opacity_Paused_With_FillBehaviorHold_Then_Hold - on Android (Youssef: Can't repro. Enabling in test: Enable DoubleAnimation_Tests #13082)
  • When_Transforms_Paused_With_FillBehaviorStop_Then_Hold. This test tends to fail when run alone, indicating a race condition, see in the comments for screenshots of the test. (Youssef: Can't repro. Enabling in test: Enable DoubleAnimation_Tests #13082)
    1) Failed : SamplesApp.UITests.Windows_UI_Xaml_Media_Animation.DoubleAnimation_Tests.When_Transforms_Paused_With_FillBehaviorStop_Then_Hold
    ImageAssert.AreEqual @ line 85
    pixelTolerance: No color tolerance
    expected: Initial (When_Transforms_Paused_With_FillBehaviorStop_Then_Hold_Initial.png {Width=1280, Height=800}) in 
    {X=615,Y=442,Width=50,Height=50}
    actual  : Final (When_Transforms_Paused_With_FillBehaviorStop_Then_Hold_Final.png {Width=1280, Height=800}) in 
    {X=615,Y=442,Width=50,Height=50}
    
  • iOS/Android Given_ImageBrushStretch (Incorrect RenderTargetBitmap content) (youssef: Issue not related to RenderTargetBitmap. Fixing test in test: Unskip and fix When_Stretch test #13081)

Done

@MartinZikmund MartinZikmund added kind/bug Something isn't working epic difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding labels Jun 20, 2022
@Youssef1313
Copy link
Member

When_Reorder_To_Last_2 on WASM, Android

This test appears to be Wasm only. I'm disabling in #9571

@jeromelaban
Copy link
Member

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

@jeromelaban jeromelaban added the area/tests 🧪 Categorizes an issue or PR as relevant to tests label Dec 15, 2022
MartinZikmund added a commit that referenced this issue May 5, 2023
GitHub Issue (If applicable): related to #9080

<!-- Link to relevant GitHub issue if applicable. All PRs should be
associated with an issue (GitHub issue or internal), unless the change
is documentation related. -->

## PR Type

What kind of change does this PR introduce?
<!-- Please uncomment one or more that apply to this PR

- Bugfix
- Feature
- Code style update (formatting)
- Refactoring (no functional changes, no api changes)
- Build or CI related changes
- Documentation content changes
- Project automation
- Other... Please describe:

-->

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or
link to a relevant issue. -->


## What is the new behavior?

<!-- Please describe the new behavior after your modifications. -->


## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Docs have been added/updated which fit [documentation
template](https://github.com/unoplatform/uno/blob/master/doc/.feature-template.md)
(for bug fixes / features)
- [ ] [Unit Tests and/or UI
Tests](https://github.com/unoplatform/uno/blob/master/doc/articles/uno-development/working-with-the-samples-apps.md)
for the changes have been added (for bug fixes / features) (if
applicable)
- [ ] Validated PR `Screenshots Compare Test Run` results.
- [ ] Contains **NO** breaking changes
- [ ] Associated with an issue (GitHub or internal) and uses the
[automatic close
keywords](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue).
- [ ] Commits must be following the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary)
specification.

<!-- If this PR contains a breaking change, please describe the impact
and migration path for existing applications below.
     Please note that breaking changes are likely to be rejected -->

## Other information

<!-- Please provide any additional information if necessary -->

Internal Issue (If applicable):
<!-- Link to relevant internal issue if applicable. All PRs should be
associated with an issue (GitHub issue or internal) -->
@ramezgerges
Copy link
Contributor

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
Copy link
Contributor

ramezgerges commented Jul 30, 2023

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
Copy link
Member

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
Copy link
Member

Youssef1313 commented Aug 2, 2023

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.

<PropertyGroup>
<!--
Ensures that AssignLinkMetadata runs before AssignTargetPaths.
Otherwise, AssignTargetPath will generate a rooted path and will break embedded sources
LogicalName metadata's behavior.
-->
<AssignTargetPathsDependsOn>$(AssignTargetPathsDependsOn);AssignLinkMetadata</AssignTargetPathsDependsOn>
</PropertyGroup>

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

MartinZikmund added a commit that referenced this issue Oct 15, 2023
@Youssef1313 Youssef1313 removed their assignment Feb 1, 2024
@ramezgerges ramezgerges removed their assignment Feb 15, 2024
@morning4coffe-dev morning4coffe-dev removed their assignment Mar 7, 2024
MartinZikmund added a commit that referenced this issue May 7, 2024
MartinZikmund added a commit that referenced this issue May 7, 2024
agneszitte added a commit that referenced this issue Feb 25, 2025
…ndBarTestOnAndroid

test: Disable flaky ValidateDynamicOverflowOrderBasic() test on Android (#9080, #19585)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tests 🧪 Categorizes an issue or PR as relevant to tests difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding epic kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants