Repository navigation
[net11] Disable Play Store auto-updates on CI Android emulators - #40357
Conversation
Play Store images auto-update Google Play services minutes after boot. Replacing com.google.android.gms force-restarts every process that loaded its modules, killing the app under test mid-run. Disable com.android.vending in PrepareDevice on CI so GMS stays at the image version. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.sh | bash -s -- 40357Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/maui/main/eng/scripts/get-maui-pr.ps1) } 40357" |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
/rebase |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
PR Test Gate
🧪 Gate analysis — click to expand⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect. No interpretable test-group summary was produced. No additional test execution is inferred. Setup did not capture a verified PR head; no commit is claimed as tested. No immutable without-fix baseline was prepared. |
There was a problem hiding this comment.
Expert Review — 0 findings
Reviewed commit 2d76f65.
|
CI validation of 2d76f65 (maui-pr-uitests 1687006, from raw job logs)
|
This comment has been minimized.
This comment has been minimized.
PR Test Gate
🧪 Gate analysis — click to expand⚠ Inconclusive. Setup, build, or execution did not produce a conclusive result. This does not prove the fix is incorrect. No interpretable test-group summary was produced. No additional test execution is inferred. Setup did not capture a verified PR head; no commit is claimed as tested. No immutable without-fix baseline was prepared. |
There was a problem hiding this comment.
Expert Review — 0 findings
Reviewed commit 2d76f65.
Source assessment incomplete (4/5 dimensions); finding count is partial.
…et#40357) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change CI hardening only: no product, test, or assertion changes. The Android UI-test emulators use `google_apis_playstore` images (API 30 and API 36, `eng/pipelines/common/ui-tests.yml`). A few minutes after boot, the Play Store (Finsky, `reason=auto_update`) downloads and installs a newer Google Play services APK. No Google account is needed for this. Replacing `com.google.android.gms` makes every process that loaded its dynamite/Chimera modules restart itself. The MAUI HostApp is one of those processes: ``` PackageManager: Force stopping com.google.android.gms ... pkg removed DynamiteLoaderV2Impl / ChimeraModuleLdr: Module config changed, forcing restart due to module googlecertificates | maps_dynamite Sending signal. PID: <app> SIG: 9 ActivityManager: Process com.microsoft.maui.uitests (pid <app>) has died: fg TOP ``` The running UI test then fails in TearDown with "The app was expected to be running still". The in-job retry usually recovers, but the crash costs a retry. It can also fail the job when the kill lands during the retry. This PR disables the Play Store package on CI emulators in `PrepareDevice`, using `pm disable-user --user 0 com.android.vending`. That call works without root on user builds. - Google Play services itself stays enabled and unchanged. - The disabled state persists across the emulator recovery restarts, because they don't wipe data. - It runs only under `IsCIBuild()`, so local developer emulators aren't touched. - On images without the Play Store, `SafeAdbShell` just logs the harmless `pm` error. #### CI evidence The same sequence appears in the drop logcats of three app crashes that the in-job retry recovered, in candidate UI build [1686708](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1686708): - Material3 on API 36: GMS replaced about 4 minutes after emulator start. - SafeAreaEdges on API 36. - Border/Button on API 30: GMS replaced about 13 minutes after start. The same retry-recovered crashes occur on `net11` UI build [1685487](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685487), so this isn't branch-specific. Across the observed jobs, the update landed about 4–14 minutes after emulator start. `PrepareDevice` runs about 1 minute after start, before that window. #### Local validation Fresh `-wipe-data` boots of `google_apis_playstore` arm64 AVDs (pixel_5), checked every minute for GMS installs, GMS package removals, and the GMS version: | Run | Result over the monitoring window | | --- | --- | | API 30 baseline | Play Store self-updated at about 11 min. GMS updated 20.18.17 → 26.45.31 at about 13 min, with "pkg removed" and ChimeraModuleLdr "forcing restart" kills. | | API 30 + `pm disable-user` | 20 min: 0 installs, 0 GMS removals, still 20.18.17 | | API 36 baseline | GMS updated 25.07.34 → 26.45.31 at about 4 min | | API 36 + `pm disable-user`, applied about 20 s after boot | 15 min: 0 installs, 0 GMS removals, still 25.07.34 | `dotnet cake eng/devices/android.cake --target=uitest-prepare --dryrun` compiles the script. The full cake path is validated by this PR's actual `maui-pr-uitests` run. ### Issues Fixed No issue filed; this fixes flaky Android UI-test CI (app killed by a Google Play services auto-update). <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…et#40357) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change CI hardening only: no product, test, or assertion changes. The Android UI-test emulators use `google_apis_playstore` images (API 30 and API 36, `eng/pipelines/common/ui-tests.yml`). A few minutes after boot, the Play Store (Finsky, `reason=auto_update`) downloads and installs a newer Google Play services APK. No Google account is needed for this. Replacing `com.google.android.gms` makes every process that loaded its dynamite/Chimera modules restart itself. The MAUI HostApp is one of those processes: ``` PackageManager: Force stopping com.google.android.gms ... pkg removed DynamiteLoaderV2Impl / ChimeraModuleLdr: Module config changed, forcing restart due to module googlecertificates | maps_dynamite Sending signal. PID: <app> SIG: 9 ActivityManager: Process com.microsoft.maui.uitests (pid <app>) has died: fg TOP ``` The running UI test then fails in TearDown with "The app was expected to be running still". The in-job retry usually recovers, but the crash costs a retry. It can also fail the job when the kill lands during the retry. This PR disables the Play Store package on CI emulators in `PrepareDevice`, using `pm disable-user --user 0 com.android.vending`. That call works without root on user builds. - Google Play services itself stays enabled and unchanged. - The disabled state persists across the emulator recovery restarts, because they don't wipe data. - It runs only under `IsCIBuild()`, so local developer emulators aren't touched. - On images without the Play Store, `SafeAdbShell` just logs the harmless `pm` error. #### CI evidence The same sequence appears in the drop logcats of three app crashes that the in-job retry recovered, in candidate UI build [1686708](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1686708): - Material3 on API 36: GMS replaced about 4 minutes after emulator start. - SafeAreaEdges on API 36. - Border/Button on API 30: GMS replaced about 13 minutes after start. The same retry-recovered crashes occur on `net11` UI build [1685487](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685487), so this isn't branch-specific. Across the observed jobs, the update landed about 4–14 minutes after emulator start. `PrepareDevice` runs about 1 minute after start, before that window. #### Local validation Fresh `-wipe-data` boots of `google_apis_playstore` arm64 AVDs (pixel_5), checked every minute for GMS installs, GMS package removals, and the GMS version: | Run | Result over the monitoring window | | --- | --- | | API 30 baseline | Play Store self-updated at about 11 min. GMS updated 20.18.17 → 26.45.31 at about 13 min, with "pkg removed" and ChimeraModuleLdr "forcing restart" kills. | | API 30 + `pm disable-user` | 20 min: 0 installs, 0 GMS removals, still 20.18.17 | | API 36 baseline | GMS updated 25.07.34 → 26.45.31 at about 4 min | | API 36 + `pm disable-user`, applied about 20 s after boot | 15 min: 0 installs, 0 GMS removals, still 25.07.34 | `dotnet cake eng/devices/android.cake --target=uitest-prepare --dryrun` compiles the script. The full cake path is validated by this PR's actual `maui-pr-uitests` run. ### Issues Fixed No issue filed; this fixes flaky Android UI-test CI (app killed by a Google Play services auto-update). <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…et#40357) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change CI hardening only: no product, test, or assertion changes. The Android UI-test emulators use `google_apis_playstore` images (API 30 and API 36, `eng/pipelines/common/ui-tests.yml`). A few minutes after boot, the Play Store (Finsky, `reason=auto_update`) downloads and installs a newer Google Play services APK. No Google account is needed for this. Replacing `com.google.android.gms` makes every process that loaded its dynamite/Chimera modules restart itself. The MAUI HostApp is one of those processes: ``` PackageManager: Force stopping com.google.android.gms ... pkg removed DynamiteLoaderV2Impl / ChimeraModuleLdr: Module config changed, forcing restart due to module googlecertificates | maps_dynamite Sending signal. PID: <app> SIG: 9 ActivityManager: Process com.microsoft.maui.uitests (pid <app>) has died: fg TOP ``` The running UI test then fails in TearDown with "The app was expected to be running still". The in-job retry usually recovers, but the crash costs a retry. It can also fail the job when the kill lands during the retry. This PR disables the Play Store package on CI emulators in `PrepareDevice`, using `pm disable-user --user 0 com.android.vending`. That call works without root on user builds. - Google Play services itself stays enabled and unchanged. - The disabled state persists across the emulator recovery restarts, because they don't wipe data. - It runs only under `IsCIBuild()`, so local developer emulators aren't touched. - On images without the Play Store, `SafeAdbShell` just logs the harmless `pm` error. #### CI evidence The same sequence appears in the drop logcats of three app crashes that the in-job retry recovered, in candidate UI build [1686708](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1686708): - Material3 on API 36: GMS replaced about 4 minutes after emulator start. - SafeAreaEdges on API 36. - Border/Button on API 30: GMS replaced about 13 minutes after start. The same retry-recovered crashes occur on `net11` UI build [1685487](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685487), so this isn't branch-specific. Across the observed jobs, the update landed about 4–14 minutes after emulator start. `PrepareDevice` runs about 1 minute after start, before that window. #### Local validation Fresh `-wipe-data` boots of `google_apis_playstore` arm64 AVDs (pixel_5), checked every minute for GMS installs, GMS package removals, and the GMS version: | Run | Result over the monitoring window | | --- | --- | | API 30 baseline | Play Store self-updated at about 11 min. GMS updated 20.18.17 → 26.45.31 at about 13 min, with "pkg removed" and ChimeraModuleLdr "forcing restart" kills. | | API 30 + `pm disable-user` | 20 min: 0 installs, 0 GMS removals, still 20.18.17 | | API 36 baseline | GMS updated 25.07.34 → 26.45.31 at about 4 min | | API 36 + `pm disable-user`, applied about 20 s after boot | 15 min: 0 installs, 0 GMS removals, still 25.07.34 | `dotnet cake eng/devices/android.cake --target=uitest-prepare --dryrun` compiles the script. The full cake path is validated by this PR's actual `maui-pr-uitests` run. ### Issues Fixed No issue filed; this fixes flaky Android UI-test CI (app killed by a Google Play services auto-update). <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…et#40357) <!-- Please let the below note in for people that find this PR --> > [!NOTE] > Are you waiting for the changes in this PR to be merged? > It would be very helpful if you could [test the resulting artifacts](https://github.com/dotnet/maui/wiki/Testing-PR-Builds) from this PR and let us know in a comment if this change resolves your issue. Thank you! <!-- Open .NET 11 fix PRs against net11 for review; target main for next-major features. After approval, a maintainer manually retargets the fix PR to the active inflight branch and merges it directly there. Do not merge individual fixes into net11. Bots must not retarget or merge. Candidate integration into net11 and release/* changes are separate, explicitly coordinated release work. --> ### Target Branch | This PR is for | Initial base | | --- | --- | | New features, API changes, or .NET 12 work (including .NET 12 fixes) | `main` | | .NET 11 servicing fixes | `net11`, for review | | Older servicing, release integration, infrastructure, or documentation | The branch designated for that work | - [x] I selected the applicable base branch using the [contribution guide](https://github.com/dotnet/maui/blob/main/.github/CONTRIBUTING.md#choose-your-pr-base-before-starting). For .NET 11 fixes, only a maintainer retargets the approved PR to the active inflight lane and merges it after CI validates that final base. Do not merge individual fixes directly into `net11`; agents must not retarget or merge. ### Description of Change CI hardening only: no product, test, or assertion changes. The Android UI-test emulators use `google_apis_playstore` images (API 30 and API 36, `eng/pipelines/common/ui-tests.yml`). A few minutes after boot, the Play Store (Finsky, `reason=auto_update`) downloads and installs a newer Google Play services APK. No Google account is needed for this. Replacing `com.google.android.gms` makes every process that loaded its dynamite/Chimera modules restart itself. The MAUI HostApp is one of those processes: ``` PackageManager: Force stopping com.google.android.gms ... pkg removed DynamiteLoaderV2Impl / ChimeraModuleLdr: Module config changed, forcing restart due to module googlecertificates | maps_dynamite Sending signal. PID: <app> SIG: 9 ActivityManager: Process com.microsoft.maui.uitests (pid <app>) has died: fg TOP ``` The running UI test then fails in TearDown with "The app was expected to be running still". The in-job retry usually recovers, but the crash costs a retry. It can also fail the job when the kill lands during the retry. This PR disables the Play Store package on CI emulators in `PrepareDevice`, using `pm disable-user --user 0 com.android.vending`. That call works without root on user builds. - Google Play services itself stays enabled and unchanged. - The disabled state persists across the emulator recovery restarts, because they don't wipe data. - It runs only under `IsCIBuild()`, so local developer emulators aren't touched. - On images without the Play Store, `SafeAdbShell` just logs the harmless `pm` error. #### CI evidence The same sequence appears in the drop logcats of three app crashes that the in-job retry recovered, in candidate UI build [1686708](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1686708): - Material3 on API 36: GMS replaced about 4 minutes after emulator start. - SafeAreaEdges on API 36. - Border/Button on API 30: GMS replaced about 13 minutes after start. The same retry-recovered crashes occur on `net11` UI build [1685487](https://dev.azure.com/dnceng-public/public/_build/results?buildId=1685487), so this isn't branch-specific. Across the observed jobs, the update landed about 4–14 minutes after emulator start. `PrepareDevice` runs about 1 minute after start, before that window. #### Local validation Fresh `-wipe-data` boots of `google_apis_playstore` arm64 AVDs (pixel_5), checked every minute for GMS installs, GMS package removals, and the GMS version: | Run | Result over the monitoring window | | --- | --- | | API 30 baseline | Play Store self-updated at about 11 min. GMS updated 20.18.17 → 26.45.31 at about 13 min, with "pkg removed" and ChimeraModuleLdr "forcing restart" kills. | | API 30 + `pm disable-user` | 20 min: 0 installs, 0 GMS removals, still 20.18.17 | | API 36 baseline | GMS updated 25.07.34 → 26.45.31 at about 4 min | | API 36 + `pm disable-user`, applied about 20 s after boot | 15 min: 0 installs, 0 GMS removals, still 25.07.34 | `dotnet cake eng/devices/android.cake --target=uitest-prepare --dryrun` compiles the script. The full cake path is validated by this PR's actual `maui-pr-uitests` run. ### Issues Fixed No issue filed; this fixes flaky Android UI-test CI (app killed by a Google Play services auto-update). <!-- Verify the target branch follows the release workflow in docs/ReleaseBranchWorkflow.md. Infrastructure and documentation changes should target the branch where they apply. --> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Target Branch
mainnet11, for reviewFor .NET 11 fixes, only a maintainer retargets the approved PR to the active
inflight lane and merges it after CI validates that final base. Do not merge
individual fixes directly into
net11; agents must not retarget or merge.Description of Change
CI hardening only: no product, test, or assertion changes.
The Android UI-test emulators use
google_apis_playstoreimages (API 30 and API 36,eng/pipelines/common/ui-tests.yml). A few minutes after boot, the Play Store (Finsky,reason=auto_update) downloads and installs a newer Google Play services APK. No Google account is needed for this. Replacingcom.google.android.gmsmakes every process that loaded its dynamite/Chimera modules restart itself. The MAUI HostApp is one of those processes:The running UI test then fails in TearDown with "The app was expected to be running still". The in-job retry usually recovers, but the crash costs a retry. It can also fail the job when the kill lands during the retry.
This PR disables the Play Store package on CI emulators in
PrepareDevice, usingpm disable-user --user 0 com.android.vending. That call works without root on user builds.IsCIBuild(), so local developer emulators aren't touched.SafeAdbShelljust logs the harmlesspmerror.CI evidence
The same sequence appears in the drop logcats of three app crashes that the in-job retry recovered, in candidate UI build 1686708:
The same retry-recovered crashes occur on
net11UI build 1685487, so this isn't branch-specific. Across the observed jobs, the update landed about 4–14 minutes after emulator start.PrepareDeviceruns about 1 minute after start, before that window.Local validation
Fresh
-wipe-databoots ofgoogle_apis_playstorearm64 AVDs (pixel_5), checked every minute for GMS installs, GMS package removals, and the GMS version:pm disable-userpm disable-user, applied about 20 s after bootdotnet cake eng/devices/android.cake --target=uitest-prepare --dryruncompiles the script. The full cake path is validated by this PR's actualmaui-pr-uitestsrun.Issues Fixed
No issue filed; this fixes flaky Android UI-test CI (app killed by a Google Play services auto-update).