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

chore: Use AGP's managed devices for instrumentation tests #223

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

DSteve595
Copy link
Contributor

This change brings in AGP's Managed Devices, setting up a Pixel 5 on API 29 (matching the device declared in the existing GitHub workflow). It also updates the GitHub workflow to run tests on that emulator, removing the dependency on reactivecircus/android-emulator-runner.
The aim is to hopefully have more reproducibility between tests run locally versus on CI. Not sure yet whether this fixes the current flaky test issue.

@DSteve595 DSteve595 requested a review from a team as a code owner November 17, 2022 22:41
@DSteve595 DSteve595 requested a review from mpegg21 November 17, 2022 22:41
@DSteve595 DSteve595 requested a review from arriolac November 17, 2022 22:42
@DSteve595
Copy link
Contributor Author

Execution failed for task ':app:pixel5api29Setup'.
91 actionable tasks: 91 executed
> A failure occurred while executing com.android.build.gradle.internal.tasks.ManagedDeviceSetupTask$ManagedDeviceSetupRunnable
   > Gradle was not able to complete device setup for: dev29_google_x86_Pixel_5
     This could be due to having insufficient resources to provision the number of
     devices requested. Try running the test again and request fewer devices or
     fewer shards.

I also get this locally the first run, then it resolves itself. I wonder if a newer AGP would help..

@arriolac
Copy link
Contributor

You can also look at the Sunflower config (currently disabled) to see what flags you can pass in (perhaps one of those can do the trick). See: https://github.com/android/sunflower/blob/main/.github/workflows/android.yml#L66

@DSteve595
Copy link
Contributor Author

I'm betting -Pandroid.experimental.testOptions.managedDevices.setupTimeoutMinutes will help. Trying it out.

@DSteve595
Copy link
Contributor Author

Aww.

@DSteve595
Copy link
Contributor Author

Turns out setupTimeoutMinutes is a lie, it's actually in seconds! Fixed in AGP here, not sure if it's made it into a release yet.

@DSteve595
Copy link
Contributor Author

And the property seems to not be implemented in AGP 7.2, only 7.3 Need #224.

@DSteve595 DSteve595 marked this pull request as draft November 22, 2022 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants