Repository navigation
[tests] Disable known-flaky tests - #13646
simonrozsival wants to merge 4 commits into
Conversation
Context: #13429 Disable 11 tests that failed and then passed on retry of the same commit across many PRs between 2026-10-19 and 2026-11-18. Each test is tracked by its own issue, which records the evidence and the re-enable criteria. Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the targeted quarantine of known-flaky tests.
No open issues 🎉
What changed in this PR
Temporarily disables 11 known-flaky tests across .NET for Android’s build and device test suites to reduce unrelated CI failures tracked in #13429. This quarantines the tests without fixing their underlying causes.
Changes:
- Adds method-level
[Ignore]attributes, covering all parameterized cases of each selected test. - Links every ignored test to its tracking issue while preserving test implementations.
Validation reported in the PR: git diff --check passed; builds and tests were not run.
| File | Description |
|---|---|
| tests/MSBuildDeviceIntegration/Tests/PerformanceTest.cs | Ignores the XAML-change performance test. |
| tests/MSBuildDeviceIntegration/Tests/InstallTests.cs | Ignores incremental fast-deployment tests. |
| tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs | Ignores Gradle integration and Android test-template tests. |
| tests/Mono.Android-Tests/Mono.Android-Tests/System.Net.NetworkInformation/PingTest.cs | Ignores the localhost ping test. |
| tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/TrimmableTypeMapTypeManagerTests.cs | Ignores registered-peer finalization testing. |
| tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/JavaMarshalGCBridgeTests.cs | Ignores the Java-rooted peer-cycle collection test. |
| tests/Mono.Android-Tests/Mono.Android-Tests/Android.Runtime/RuntimeEventSourceTests.cs | Ignores GC bridge event-emission testing. |
| tests/Mono.Android-Tests/Java.Interop-Tests/Java.Interop/JavaObjectTest.cs | Ignores two collection and finalization tests. |
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidDependenciesTests.cs | Ignores Android dependency-installation tests. |
Review effort: Balanced
jonathanpeppers
left a comment
There was a problem hiding this comment.
Two of the tests seem more important than the others.
| [TestCase ("test", MSTestPackageChannel.Stable)] | ||
| [TestCase ("test", MSTestPackageChannel.Nightly)] | ||
| [TestCase ("list", MSTestPackageChannel.Stable)] | ||
| [Ignore ("Flaky: https://github.com/dotnet/android/issues/13643")] |
There was a problem hiding this comment.
This one seems important to catch issues, though.
| { | ||
| [Test] | ||
| [NonParallelizable] // Do not run environment modifying tests in parallel. | ||
| [Ignore ("Flaky: https://github.com/dotnet/android/issues/13644")] |
There was a problem hiding this comment.
This one failed on two recent PRs, and it actually needs me to fix a manifest URL: https://aka.ms/AndroidManifestFeed/d18-0
main uses a copy in the repo, but servicing branches use the live URL.
|
@jonathanpeppers I suggest merging this as is an then address each individual problem as soon as possible to reinstante those tests. I think it's OK if we disable even some of the more imporant tests for a few days. On the other hand, I don't mind fixing some of the tests before we merge this PR. |
Keep the Android test template and dependency installation tests enabled to retain their coverage. Co-authored-by: Copilot App <[email protected]>
|
Co-authored-by: Copilot App <[email protected]>
This reverts commit f46494b.
|
Closing this blanket-disable PR in favor of targeted changes: #13676 removes Build_XAML_Change and IncrementalFastDeployment; #13675 addresses the GC bridge tests; #13666 addresses platform-tools version resolution. GradleFBProj (#13640) and PingLocalhost (#13642) remain enabled and are the two remaining investigations. No tracking issues are being closed by this action. |
Fixes: #13637 Fixes: #13645 Fixes: #13638 Fixes: #13639 Fixes: #13275 Context: #13646 Several GC bridge tests fail intermittently on CI: ``` ManagedPeerCycleSurvivesJavaRootAndIsCollectedAfterRelease Expected collection to not be empty. The Java-rooted cycle must participate in global-to-weak bridge processing. GCBridgeRoundEmission GC bridge Start and Stop events should be emitted as matched pairs. Dispose_Finalized / RegisteredPeer_Dispose_Finalized Expected ...Dispose(disposing: false) to run. UnreferencedInstanceIsCollected Expected the unreferenced instance to be collected. ``` ### Cause The bridge itself works as designed; the tests' waits are wrong. Bridge rounds run one at a time on a background thread. While a round is running, a GC does not start another one, and `JNIEnv.BridgeProcessingGeneration` is incremented when a round ends. Each test made one of these assumptions: * **"The generation changed, so my peers were processed."** A round that started before the test's peers existed can finish during the wait (`ManagedPeerCycle...`, `JavaObjectArrayRetainsManagedValueUntilReleased`). * **"The next round writes Start/Stop events."** `ProcessBridge` checks whether the events are enabled once, when the round starts. A round already running when the listener is created writes neither event, but still bumps the generation, after which the test stops forcing GCs and waits 5 s for events that never come (`GCBridgeRoundEmission`). * **"The object will be finalized within 2 s."** A slow round, or one left over from an earlier test, uses up the whole budget (`Dispose_Finalized`, `RegisteredPeer_Dispose_Finalized`, `UnreferencedInstanceIsCollected`). ### Fix `GCBridgeTestHelpers.WaitForBridgeRoundsAsync()` reads the generation and waits for three more rounds to complete, forcing a GC with a throwaway peer every 10 ms so a new round can always start. When the wait begins, one round may still be running and the next may already be queued with objects gathered by an earlier GC, so the third round to complete must have started from a GC after the wait began. That round has processed the test's peers. The second round's callback also started after the wait began, so its Start/Stop events have been written. `CollectUnreachablePeersAsync()` follows the wait with a GC, `WaitForPendingFinalizers()`, and a second GC. The tests now assert directly after the wait instead of polling a predicate. Their deadline is `[Timeout (60_000, CooperativeCancellation = true)]`, which only fires if something is actually broken. `GCBridgeRoundEmission` now matches Start and Stop by event ID, because TypeMap events from other threads can be written between them. Co-authored-by: Copilot App <[email protected]>
Context: #13646, #13644 `InstallAndroidDependenciesTest` fails on `main` because Google removed platform-tools 37.0.1 from its SDK catalog. Android CLI 1.1.16717390 returns success for `[email protected]` but logs `No url for platform-tools. Ignoring.`, so platform-tools is not installed. Update platform-tools to 37.0.3, which is in the current catalog: * `$(XAPlatformToolsVersion)` and the macOS, Linux, and Windows SHA-256 hashes in `Configuration.props`. * The shipped `$(AndroidSdkPlatformToolsVersion)` default used by the `InstallAndroidDependencies` target. * A 37.0.3 entry in `AndroidManifestFeed_d18.0.xml`. Without it, `WorkloadDependencies.json` falls back to the newest feed revision, 37.0.1. Sizes and SHA-1 checksums come from https://dl.google.com/android/repository/repository2-3.xml. Google can remove 37.0.3 later in the same way. #13691 changes `<InstallAndroidDependencies/>` to roll forward to the newest stable platform-tools in the same major version. Co-authored-by: Copilot App <[email protected]> Co-authored-by: Jonathan Peppers <[email protected]>
Context: #13646, #13636, #13641, #13446 Remove Build_XAML_Change and IncrementalFastDeployment instead of disabling them. Build-performance measurement will be handled separately from the general integration suite. IncrementalFastDeployment already uses zero-work assertions rather than elapsed-time comparisons; its removal is intentional. Remove the orphaned XAML timing budgets and structured-logger import. Preserve the remaining PerformanceTest fixture and separate functional deployment tests. Validation: MSBuildDeviceIntegration compilation passed with no warnings or errors, test discovery passed with the removed cases absent, and git diff --check passed. Co-authored-by: Copilot App <[email protected]>
Fixes: #13636 Fixes: #13641 Context: #13429 Context: #13646 Context: #13446 ### Problem `MSBuildDeviceIntegration` contained a timing-based performance fixture and a flaky incremental deployment test: * `PerformanceTest` compared wall-clock build, install, and design-time-build durations with hard-coded budgets in `tests/msbuild-times-reference/MSBuildDeviceIntegration.csv`. * `InstallTests.IncrementalFastDeployment` used a Xamarin.Forms XAML scenario and was flaky in CI (#13641). Its elapsed-time comparisons had already been replaced with no-work assertions in #13446. Measuring performance inside functional test runs is unreliable. These tests run on shared CI agents and emulators where CPU contention, disk and emulator I/O, cold caches, and the previous test's state can change timings by more than the regressions they are meant to catch. Loose budgets can miss regressions, while tighter budgets cause flaky failures (for example `Build_XAML_Change`, #13636). The results are often ignored and cannot reliably surface performance regressions at the PR level. #13646 explored disabling the flaky cases; this change replaces that approach. ### Changes **Remove the timing tests.** Delete the whole `PerformanceTest` fixture rather than marking cases `[Ignore]`: * `Build_No_Changes`, `Build_CSharp_Change`, `Build_AndroidResource_Change`, `Build_AndroidAsset_Change`, `Build_AndroidManifest_Change`, `Build_XAML_Change` * `Install_CSharp_Change`, `Install_CSharp_FromClean` * `DesignTimeBuild_CSharp_From_Clean` Its budget file, `tests/msbuild-times-reference/MSBuildDeviceIntegration.csv`, is deleted too; nothing else reads it. Separate, more robust build-time and runtime benchmarks will replace this performance coverage as part of the .NET 12 work. **Keep `IncrementalFastDeployment` functional and timing-independent.** The test is kept for APK and AAB packaging and verifies incremental fast deployment correctness and skipped work without build-speed assertions. #13446 had already removed its elapsed-time comparisons; this change also removes the Xamarin.Forms dependency and its XAML scenario. It uses a plain Android app that logs values from two project-reference libraries, `Library1` (an Android library) and `Library2` (`netstandard2.0`): 1. Build and install the app, run it, and verify that logcat contains `INCREMENTAL_FAST_DEPLOY:500:40`. 2. Install again with no changes. Verify selected build and deployment work is skipped: * Skipped targets: `CoreCompile`, `_CompileToDalvik`, `_BuildApkFastDev`, `_Upload` (AAB: `_BuildApkSet`, `_DeployAppBundle`). `_GenerateTrimmableTypeMap` may be skipped or absent. * The install binlog runs none of these tasks: `Csc`, `GenerateTrimmableTypeMap`, `D8`, `R8`, `BuildApk`, `BuildAppBundle`, `BuildApkSet`, `InstallApkSet`, `FastDeploy`. 3. Change `Library1.Class1.GetValue ()` from `500` to `501`. The test verifies that the assembly contents change but its size does not. This guards against change detection based only on file size. Explicitly rebuild that library, because `Xamarin.ProjectTools` builds with `BuildingInsideVisualStudio=true`, which does not rebuild project references automatically; verify that `Csc` ran. 4. Install the app again. Verify: * `FastDeploy` runs, but `_CompileToDalvik` and `_BuildApkFastDev` are skipped (AAB: `_BuildApkSet` and `_DeployAppBundle` are also skipped). The binlog runs none of `Csc`, `D8`, `R8`, `BuildApk`, `BuildAppBundle`, `BuildApkSet`, or `InstallApkSet`. * The unchanged `Library2.dll` is not uploaded again (`NotifySync SkipCopyFile`), and no redundant files are removed (`Remove redundant file`). * The running app logs `INCREMENTAL_FAST_DEPLOY:501:40`, proving the updated assembly was deployed and loaded. 5. Repeat the no-change install checks from step 2, then uninstall the app. No step asserts build or install duration. The only time limit is a timeout while waiting for the app's logcat output, so the test fails instead of hanging if the app never starts. The other functional deployment tests (`AppBundleDeploymentInvalidation`, `AdbTargetChangesAppBundle`, `ReInstallIfUserUninstalled`) are unchanged. There are no product code changes.
Context: #13429
These tests failed in isolation and then passed on retry of the same commit across many PRs between 2026-10-19 and 2026-11-18, leaving PR runs red. Disable each entire test until its flakiness is addressed. Each tracking issue records the evidence and criteria for re-enabling it. Keep
DotNetNewAndroidTestandInstallAndroidDependenciesTestenabled because their coverage is important; the other nine tests remain disabled.PerformanceTest.Build_XAML_ChangeJavaMarshalGCBridgeTests.ManagedPeerCycleSurvivesJavaRootAndIsCollectedAfterReleaseJavaObjectTest.Dispose_FinalizedTrimmableTypeMapTypeManagerTests.RegisteredPeer_Dispose_FinalizedInstallAndRunTests.GradleFBProjInstallTests.IncrementalFastDeploymentPingTest.PingLocalhostRuntimeEventSourceTests.GCBridgeRoundEmissionJavaObjectTest.UnreferencedInstanceIsCollectedValidation
git diff --check 5503f6a73f5d2a9a97f19d93a43761dbcacad6ca HEAD— passed.dotnet-local.cmd build Microsoft.Android.slnx -nodeReuse:false— passed with 29 warnings.dotnet-local.cmd test bin\TestDebug\net11.0\Xamarin.Android.Build.Tests.dll --list-tests --filter "Name~InstallAndroidDependenciesTest"— discovered both cases.dotnet-local.cmd test bin\TestDebug\MSBuildDeviceIntegration\net11.0\MSBuildDeviceIntegration.dll --list-tests --filter "Name~DotNetNewAndroidTest"— discovered all four cases.