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

MAUI tests fail frequently and aren't easily diagnosable #3617

Closed
JeremyKuhne opened this issue Jul 21, 2020 · 9 comments · Fixed by #3600, #6091, #6257, #6262 or #6396
Closed

MAUI tests fail frequently and aren't easily diagnosable #3617

JeremyKuhne opened this issue Jul 21, 2020 · 9 comments · Fixed by #3600, #6091, #6257, #6262 or #6396
Assignees
Labels
test-bug Problem in test source code (most likely)

Comments

@JeremyKuhne
Copy link
Member

These are an attempt to shim in the old internal tests (note that MAUI here is an old internal test framework). The old tests worked quite differently and don't fit in well with the current test infrastructure. We're getting frequent intermittent failures like so:

System.Windows.Forms.Maui.IntegrationTests.WinformsMauiButtonTests.MauiButtonTest(scenarioName: \"Hotkey_Fires_OnClick\")

Assert.Equal() Failure\r\n          ↓ (pos 0)\r\nExpected: Pass\r\nActual:   Fail\r\n          ↑ (pos 0)

Stack trace
   at System.Windows.Forms.Maui.IntegrationTests.MauiTestHelper.ValidateScenarioPassed(String projectName, String scenarioName) in /_/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.Maui.IntegrationTests/MauiTestHelper.cs:line 90
   at System.Windows.Forms.Maui.IntegrationTests.WinformsMauiButtonTests.MauiButtonTest(String scenarioName) in /_/src/System.Windows.Forms/tests/IntegrationTests/System.Windows.Forms.Maui.IntegrationTests/WinformsMauiButtonTests.cs:line 35

This doesn't really help you much and it isn't obvious as to what you can do to move forward. In addition, the MAUI infrastructure sources aren't available so it is difficult to understand how the whole system works.

My recommendation (and current POR):

  1. Disable the MAUI tests for now
  2. Make them more xUnit-like and have any shim code in the repo
  3. If we can make the tests plug in as a "normal" xUnit test then re-enable them for the CI, otherwise leave them for manual runs

cc: @AdamYoblick, @RussKie

Failed with #3600

@JeremyKuhne JeremyKuhne added test-bug Problem in test source code (most likely) Priority:1 Work that is critical for the release, but we could probably ship without labels Jul 21, 2020
@JeremyKuhne JeremyKuhne added this to the 5.0 RC1 milestone Jul 21, 2020
@merriemcgaw
Copy link
Member

We ought to rethink our approach to those old tests. I think now, thanks to our amazing contributors, we've got a lot more coverage and don't necessarily need the old school style tests. I'll work with @dreddy-work , @Olina-Zhang and a few others to make sure we have the scenarios covered in our new infrastructure, or rewritten from scratch. It just seems like the right approach here. Go ahead and disable them for the time being, I don't think we're losing much. @Olina-Zhang just to be safe, can you run the MAUI tests once or twice per-preview internally?

@AdamYoblick
Copy link
Member

I agree, these tests are pretty fragile. Merrie asked me a while back to see if I could add the manual MAUI runs to our test automation, so that's what all the shims are. 😄

@Olina-Zhang
Copy link
Member

@merriemcgaw, So far we run all migrated Maui cases in our every regular .net 5.0 SDK testing, once a week, these cases can ensure no big regression issue entering.

@weltkante
Copy link
Contributor

weltkante commented Jul 22, 2020

I don't think the xunit tests are covering anything regarding input infrastructure at all? The problem is tests doing input coverage can't be multithreaded (input/focus is a global resource) so xunit is not really a good fit. We've actively been moving away some of the flaky tests from xunit too, either to RemoteExecutor or MAUI (RemoteExecutor currently being even more broken than MAUI)

@merriemcgaw
Copy link
Member

merriemcgaw commented Jul 23, 2020

Given these scenarios are part of the manual suite of tests, I think we can disable the most flaky ones. We should have a separate effort to refactor and improve the integration test bed. In the interim we don't want them in CI.

@RussKie
Copy link
Member

RussKie commented Jul 27, 2020

@SergeySmirnov-Akvelon as discussed please disable the integration tests for #3600

diff --git a/eng/ci.yml b/eng/ci.yml
index 829f86639..d21577582 100644
--- a/eng/ci.yml
+++ b/eng/ci.yml
@@ -125,13 +125,14 @@ stages:
         # Run Integration Tests
         # Tests are run with /m:1 to avoid parallelism across different assemblies which can lead to
         # UI race conditions
-        - script: eng\cibuild.cmd
-            -integrationTest
-            -configuration $(_BuildConfig)
-            $(_OfficialBuildIdArgs)
-            /bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\IntegrationTest.binlog
-            /m:1
-          displayName: Run Integration Tests
+        # Flaky tests, see: https://github.com/dotnet/winforms/issues/3617
+        # - script: eng\cibuild.cmd
+        #     -integrationTest
+        #     -configuration $(_BuildConfig)
+        #     $(_OfficialBuildIdArgs)
+        #     /bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\IntegrationTest.binlog
+        #     /m:1
+        #   displayName: Run Integration Tests
 
         # Create Nuget package, sign, and publish
         - script: eng\cibuild.cmd

@RussKie RussKie modified the milestones: 5.0 RC1, 3.1.7, 3.1.8 Jul 27, 2020
@RussKie RussKie removed the Priority:1 Work that is critical for the release, but we could probably ship without label Jul 29, 2020
@ghost ghost added the 🚧 work in progress Work that is current in progress label Aug 12, 2020
@ghost ghost removed the 🚧 work in progress Work that is current in progress label Aug 12, 2020
@JeremyKuhne
Copy link
Member Author

Got the same failure again:

System.Windows.Forms.Maui.IntegrationTests.WinformsMauiButtonTests.MauiButtonTest(scenarioName: \"Hotkey_Fires_OnClick\")

Error message
Assert.Equal() Failure\r\n          ↓ (pos 0)\r\nExpected: Pass\r\nActual:   Fail\r\n          ↑ (pos 0)

Stack trace
   at System.Windows.Forms.Maui.IntegrationTests.MauiTestHelper.ValidateScenarioPassed(String projectName, String scenarioName) in F:\workspace\_work\1\s\src\System.Windows.Forms\tests\IntegrationTests\System.Windows.Forms.Maui.IntegrationTests\MauiTestHelper.cs:line 89
   at System.Windows.Forms.Maui.IntegrationTests.WinformsMauiButtonTests.MauiButtonTest(String scenarioName) in F:\workspace\_work\1\s\src\System.Windows.Forms\tests\IntegrationTests\System.Windows.Forms.Maui.IntegrationTests\WinformsMauiButtonTests.cs:line 34

@RussKie
Copy link
Member

RussKie commented Sep 19, 2020 via email

@RussKie RussKie removed this from the 3.1.8 milestone Oct 7, 2020
@RussKie RussKie added this to the 6.0 Preview1 milestone Oct 29, 2020
@RussKie RussKie modified the milestones: 6.0 Preview1, 6.0 Preview2, 6.0 Jan 27, 2021
@dreddy-work dreddy-work modified the milestones: 6.0, 7.0 Aug 27, 2021
@ghost ghost added the 🚧 work in progress Work that is current in progress label Nov 1, 2021
@ghost ghost removed this from the 7.0 milestone Nov 23, 2021
@RussKie RussKie reopened this Nov 23, 2021
@RussKie
Copy link
Member

RussKie commented Nov 23, 2021

Keeping it open until we migrate all MAUI tests into the new project.

@RussKie RussKie added this to the 7.0 milestone Nov 23, 2021
@ghost ghost removed the 🚧 work in progress Work that is current in progress label Nov 23, 2021
@ghost ghost added the 🚧 work in progress Work that is current in progress label Dec 2, 2021
@ghost ghost removed this from the .NET 7.0 milestone Dec 15, 2021
@ghost ghost removed the 🚧 work in progress Work that is current in progress label Jan 21, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Feb 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.