Fix flaky DebuggingTest.ApplicationRunsWithoutDebugger: increase activity-start timeout from 30s to 150s#11811
Merged
jonathanpeppers merged 2 commits intoJun 30, 2026
Conversation
The 30-second timeout in ApplicationRunsWithoutDebugger (and other tests) was too short for emulators that can take 100+ seconds to launch an app, especially after SwitchUser(). Move the ActivityStartTimeoutInSeconds=150 constant to DeviceTest base class so it's shared across all device tests, and update DebuggingTest, FastDevTest, and BundleToolNoAbiSplitTests to use this constant instead of the hardcoded 30. Fixes #11810 Co-authored-by: simonrozsival <374616+simonrozsival@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix flaky device test for ApplicationRunsWithoutDebugger
Fix flaky Jun 29, 2026
DebuggingTest.ApplicationRunsWithoutDebugger: increase activity-start timeout from 30s to 150s
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses flakiness in MSBuild device integration tests by standardizing a longer, CI-friendly activity-start timeout for WaitForActivityToStart, reducing failures caused by slow emulator app launches (notably after SwitchUser()).
Changes:
- Moved
ActivityStartTimeoutInSeconds = 150into the sharedDeviceTestbase class so all device tests can use the same default. - Removed the duplicate
ActivityStartTimeoutInSecondsconstant fromInstallAndRunTestsnow that it’s inherited fromDeviceTest. - Updated several tests to use
ActivityStartTimeoutInSecondsinstead of a hardcoded 30-second timeout.
Show a summary per file
| File | Description |
|---|---|
| tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs | Removes the duplicated timeout constant, relying on the shared base class. |
| tests/MSBuildDeviceIntegration/Tests/FastDevTest.cs | Switches activity-start wait timeout from hardcoded 30 to ActivityStartTimeoutInSeconds. |
| tests/MSBuildDeviceIntegration/Tests/DebuggingTest.cs | Updates flaky activity-start waits to use the standardized 150s timeout constant. |
| tests/MSBuildDeviceIntegration/Tests/BundleToolNoAbiSplitTests.cs | Uses the shared timeout constant for activity-start detection. |
| src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/Utilities/DeviceTest.cs | Introduces the shared ActivityStartTimeoutInSeconds = 150 constant with existing rationale preserved. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 0
jonathanpeppers
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DebuggingTest.ApplicationRunsWithoutDebuggerwas flaking ~12 times over 5 days across all CoreCLR configurations. The test calledWaitForActivityToStartwith a 30-second timeout, but CI emulators (especially afterSwitchUser()) can take 100+ seconds to display the "Displayed:" logcat line.InstallAndRunTestsalready had a well-documentedActivityStartTimeoutInSeconds = 150constant for exactly this reason — it just wasn't shared.Changes
ActivityStartTimeoutInSeconds = 150toDeviceTestbase class — removes the bottleneck where each test class had to rediscover this and hardcode 30sInstallAndRunTests— inherits from base; all existing usages (ActivityStartTimeoutInSecondsbare name andInstallAndRunTests.ActivityStartTimeoutInSecondsqualified) continue to resolve correctlyDebuggingTest.ApplicationRunsWithoutDebugger(primary flake)DebuggingTest.ClassLibraryMainLauncherRunsFastDevTestBundleToolNoAbiSplitTests