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

Android driver timeout when running on GitHub Actions #144

Closed
AdamMc331 opened this issue Sep 8, 2022 · 11 comments
Closed

Android driver timeout when running on GitHub Actions #144

AdamMc331 opened this issue Sep 8, 2022 · 11 comments
Labels
platform: android Testing Android apps is affected

Comments

@AdamMc331
Copy link

I've tried to add Maestro to my project with this PR and after running the tests on GitHub Actions, I received the following error:

java.util.concurrent.TimeoutException: Maestro Android driver did not start up in time
	at maestro.drivers.AndroidDriver.awaitLaunch(AndroidDriver.kt:104)
	at maestro.drivers.AndroidDriver.open(AndroidDriver.kt:78)
	at maestro.Maestro$Companion.android(Maestro.kt:305)
	at maestro.Maestro$Companion.android$default(Maestro.kt:303)
	at maestro.cli.util.MaestroFactory.createAndroid(MaestroFactory.kt:54)
	at maestro.cli.util.MaestroFactory.createMaestro(MaestroFactory.kt:35)
	at maestro.cli.command.TestCommand.call(TestCommand.kt:58)
	at maestro.cli.command.TestCommand.call(TestCommand.kt:30)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
	at picocli.CommandLine.access$1200(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2[159](https://github.com/AdamMc331/TOA/runs/8240575616?check_suite_focus=true#step:5:163))
	at picocli.CommandLine.execute(CommandLine.java:2058)
	at maestro.cli.AppKt.main(App.kt:74)

Additional notes:

Here is my action workflow setup:

- name: Run Tests
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: 29
          script: |
            maestro --platform android test maestro_tests/login.yaml
            maestro --platform android test maestro_tests/create_task.yaml
            maestro --platform android test maestro_tests/mark_task_as_done.yaml
            maestro --platform android test maestro_tests/undo_mark_task_as_done.yaml

The maestro commands should run as soon as the emulator is up and running. I noticed that my APK was not yet installed, so I am trying this again with that step first, but I don't think they're related, as I would have expected some package not found error & not a driver timeout.

@AdamMc331
Copy link
Author

For what it's worth, this error went away once I changed this to install my APK before the Maestro steps. However, it failed on GitHub Actions due to other reasons (being unable to tap on a component), but I'll keep digging into why that happened.

@dmitry-zaitsev dmitry-zaitsev added help wanted platform: android Testing Android apps is affected labels Sep 8, 2022
@dmitry-zaitsev
Copy link
Contributor

Thanks for reporting @AdamMc331, this adds more urgency for us to add support for screenshots and screen recordings to make it more clear what is going on whenever a test fails

@dmitry-zaitsev
Copy link
Contributor

@AdamMc331 heads up that Maestro now supports screenshots: https://maestro.mobile.dev/reference/take-screenshot

Please let me know if you have more context on the issue and I will investigate

@carlosmuvi-stripe
Copy link

Hi! I'm trying a setup that's pretty similar as @AdamMc331's (including installing apk before launching maestro tests), but still see maestro timing out:

https://github.com/stripe/stripe-android/actions/runs/3153366328/jobs/5130023285#step:5:593

@carlosmuvi-stripe
Copy link

carlosmuvi-stripe commented Sep 30, 2022

Update - seems like extending the SERVER_LAUNCH_TIMEOUT_MS fixes timeouts on Github Actions.

Is this something that can be made configurable / simply extend? or rather there's reasoning behind the specific value?

@cmonfortep
Copy link

We are also seeing the Timeout exception in our workflows:
java.util.concurrent.TimeoutException: Maestro Android driver did not start up in time
https://github.com/duckduckgo/Android/actions/runs/3197633505/jobs/5221108632#step:12:1726

@dvdciri
Copy link

dvdciri commented Oct 20, 2022

This is happening to us as well. Is there any plans to extend SERVER_LAUNCH_TIMEOUT_MS or make it configurable? @AdamMc331

@elowareAdm
Copy link

same inssue here

@dvdciri
Copy link

dvdciri commented Oct 26, 2022

Thanks for this @dmitry-zaitsev #316
🤞🏼 This will help, looking forward to a release containing this

@henriquenfaria
Copy link

Same issue on Azure Pipelines!

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar problem, please file a new issue. Make sure to follow the template and provide all the information necessary to reproduce the issue.
Thank you for helping keep us our issue tracker clean!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: android Testing Android apps is affected
Projects
None yet
Development

No branches or pull requests

7 participants