Repository navigation
[tests] Wait for device state and bound output draining - #13697
Draft
simonrozsival wants to merge 4 commits into
Draft
simonrozsival wants to merge 4 commits into
simonrozsival wants to merge 4 commits into
Conversation
simonrozsival
force-pushed
the
dev/simonrozsival/timing-device-readiness
branch
from
November 21, 2026 16:00
4a0b204 to
dbaa2e3
Compare
simonrozsival
force-pushed
the
dev/simonrozsival/timing-device-readiness
branch
from
November 23, 2026 07:20
dbaa2e3 to
b78223e
Compare
simonrozsival
force-pushed
the
dev/simonrozsival/timing-device-readiness
branch
from
November 23, 2026 07:37
b78223e to
2e12421
Compare
7 tasks
Track and clean up the pipe-holding child, using its PID file if the output handshake fails. Assert that draining reports incomplete output while the child is still alive, with a generous hang watchdog instead of a narrow elapsed-time threshold. Co-authored-by: Copilot App <[email protected]>
The fixture already checks the requested timezone property before launching a fresh app process; remove the additional fixed sleep. Use the configured adb target when installing the fixture. Co-authored-by: Copilot App <[email protected]>
Observe the framework services stopped by the Android stop command, with exit-code-aware polling bounded by a single deadline, and require the boot-completed signal and expected locale property before launching the app, instead of sleeping for fixed intervals. Use the configured adb target when installing the fixture. Co-authored-by: Copilot App <[email protected]>
Keep the state-based worker and collection assertions while allowing for slow scheduling on loaded devices. Preserve zero-duration timeout cases. Co-authored-by: Copilot App <[email protected]>
jonathanpeppers
force-pushed
the
dev/simonrozsival/timing-device-readiness
branch
from
November 23, 2026 14:55
2e12421 to
abe7a0f
Compare
This branch has not been deployed
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.
Device and process tests should wait for the state they require, while retaining timeouts only to detect hangs.
Windows redirected-output draining
Track and clean up the child that inherits the output handles, using its PID file if the output handshake fails. Assert that draining reports incomplete output while that child is still alive, with a generous watchdog rather than a narrow stopwatch range.
Timezone readiness
The fixture already waits until the requested timezone property is set before launching a fresh app process. Remove the additional fixed sleep and pass the selected device to the install so a second attached emulator cannot receive the fixture.
Localization service restart
After stopping Android services, poll their actual states using exit-code-aware ADB calls under one aggregate deadline, then restart services in
finally. Require both the boot-completed signal and the requested locale property before starting the app. A failedgetpropcan no longer look like a stopped service, and a slow device is not expected to become ready within a fixed sleep.JNI collection watchdogs
Keep the existing worker-state and collection assertions, but allow a longer watchdog for loaded devices. Preserve zero-duration timeout cases. The watchdog still detects a hang; it is not used as a performance assertion.
Validation
Validation was run with all five layers applied on macOS and an API 35 arm64 emulator; intermediate branch heads were not built separately.
./dotnet-local.sh test bin/TestDebug/net11.0/Xamarin.Android.Build.Tests.dll --filter 'FullyQualifiedName~RemoveDirTests|Name~CancelStopsKeytool|Name~BuilderDoesNotWaitForInheritedRedirectedOutput' -v minimal— passed: 10 passed and 3 skipped, including the Windows-only drain test, on macOS.ADB_TARGET='-s emulator-5558' ./dotnet-local.sh test bin/TestDebug/MSBuildDeviceIntegration/net11.0/MSBuildDeviceIntegration.dll --filter 'Name~CheckLocalizationIsCorrectWithSlicer&Name~fr-FR' -v minimal— passed (CoreCLR and NativeAOT).ADB_TARGET='-s emulator-5558' ANDROID_SERIAL=emulator-5558 ./dotnet-local.sh test bin/TestDebug/MSBuildDeviceIntegration/net11.0/MSBuildDeviceIntegration.dll --filter '(Name~UnknownSystemLibraryLoadsWithoutMainThreadDispatch|Name~ExemptJniLibraryLoadsOnWorkerThreadWithBlockedMainThread|(Name~CheckTimeZoneInfoIsCorrectWithSlicer&Name~Europe/Prague))' --logger 'console;verbosity=normal'— passed (5 device cases, including timezone checks on CoreCLR and NativeAOT)../dotnet-local.sh build -t:Install -c Debug tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj -p:Device=emulator-5558 -p:IncludeCategories=AndroidMessageHandlerCancellation%2CJniReferenceLeakMeasurement%2CTrimmableTypeMapRuntimeCoverage -v minimal— passed.(cd tests/Mono.Android-Tests/Mono.Android-Tests && ../../../dotnet-local.sh test Mono.Android.NET-Tests.csproj --no-build -c Debug -p:Device=emulator-5558 -p:IncludeCategories=AndroidMessageHandlerCancellation%2CJniReferenceLeakMeasurement%2CTrimmableTypeMapRuntimeCoverage --report-trx --results-directory ../../../bin/TestDebug/ReviewCoreCLRResults)— passed 55 cases in each of 3 CoreCLR runs on API 35 arm64../dotnet-local.sh msbuild tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj -getProperty:_AndroidRuntime -p:PublishAot=true -p:Optimize=true -p:RuntimeIdentifier=android-arm64 -p:Configuration=Debug -p:Device=emulator-5558— returnedNativeAOT../dotnet-local.sh build -t:Install -c Debug tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj -p:Device=emulator-5558 -p:RuntimeIdentifier=android-arm64 -p:PublishAot=true -p:Optimize=true -p:IncludeCategories=AndroidMessageHandlerCancellation%2CJniReferenceLeakMeasurement%2CTrimmableTypeMapRuntimeCoverage -v minimal— passed.(cd tests/Mono.Android-Tests/Mono.Android-Tests && ../../../dotnet-local.sh test Mono.Android.NET-Tests.csproj --no-build -c Debug -p:Device=emulator-5558 -p:RuntimeIdentifier=android-arm64 -p:PublishAot=true -p:Optimize=true -p:IncludeCategories=AndroidMessageHandlerCancellation%2CJniReferenceLeakMeasurement%2CTrimmableTypeMapRuntimeCoverage --report-trx --results-directory ../../../bin/TestDebug/ReviewNativeAotResults)— passed 55 cases in each of 2 NativeAOT runs.The drain tests establish bounded completion while the child retains its handles; they do not enforce an exact two-second duration. The Windows-specific path was not exercised locally.