mobile-dev-inc / maestro

Painless Mobile UI Automation
https://maestro.mobile.dev/
Apache License 2.0
5.85k stars 276 forks source link

[v1.34.0][BUG] - Exception in thread "pool-4-thread-1" java.io.IOException: Command failed (host:transport:emulator-5554): device offline #1573

Open talhaoz opened 1 year ago

talhaoz commented 1 year ago

When running short operations maestro, its running fine. Even I run all the commands separately its working without an issue. But once I combine the tests in a single yaml file and run them respectively it always fails with this exception :

Exception in thread "pool-4-thread-1" java.io.IOException: Command failed (host:transport:emulator-5554): device offline
        at dadb.adbserver.AdbServer.send$dadb(AdbServer.kt:99)
        at dadb.adbserver.AdbServerDadb.open(AdbServer.kt:137)
        at dadb.forwarding.TcpForwarder.handleForwarding$lambda-1(TcpForwarder.kt:64)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1589)

It somehow mentions the current emulator offline and not moving forward. I check if the emulator is still online and it was there. I also tried to run it with different emulators same exception.

After throwing this adb disconnected exception it also throws this one :

image

To Reproduce

  1. Start the simulator
  2. Run maestro test ...
  3. The Flow fails after running like 4 min.

Expected behavior Working as expected and not fails.

Screenshots If applicable, add screenshots to help explain your problem.

Environment information (please complete the following information):

Workspace (if applicable) Please share your workspace with Flow files and application binary if you are able to do so as that greatly helps in reproduction efforts.

Bugreport output (if applicable) The zip files created when maestro bugreport can be uploaded here as well if applicable.

Additional context Add any other context about the problem here.

talhaoz commented 1 year ago

Sometime It throws this error : Android driver unreachable

snitsaruk commented 10 months ago

@talhaoz have you found a solution for this?

DavidREntwistle commented 10 months ago

I have been able to reproduce steps for this here: https://github.com/mobile-dev-inc/maestro/issues/1525#issuecomment-1889192728 @talhaoz & @snitsaruk are you able to reproduce with these steps too?

yuseiatlas commented 9 months ago

A temporary fix that worked for me was to set the emulator's API level to 32. We had it set to 30 when the issue started showing. I tried 31, 33, and 34; however, none worked. Nonetheless, this issue has been surfacing on different threads since August with no fix or temporary workaround from the Maestro team 😞

The emulator logs didn't show any problems when the Maestro driver exception was thrown. Moreover, it wasn't happening locally, or at least it's inconsistent enough locally that I didn't come across it.

Edit: added more details.

kporokhina commented 9 months ago

I'm seeing this consistently locally, haven't tried the pipeline yet as the implementation is still in progress. Using an emulator with API 30. Anyone has any updates on this?

ubuntudroid commented 6 months ago

A temporary fix that worked for me was to set the emulator's API level to 32. We had it set to 30 when the issue started showing. I tried 31, 33, and 34; however, none worked. Nonetheless, this issue has been surfacing on different threads since August with no fix or temporary workaround from the Maestro team 😞

Interestingly, 32 is explicitly included from supported API levels when running maestro start-device. I'm wondering why. 🤔

ubuntudroid commented 6 months ago

Shot in the dark: Maybe those issues are related to running maestro on arm arch (e.g., M* Macs)?

exodus98 commented 5 months ago

Hello, I'm running maestro on i9 Macbook Pro 2019 and api-32 emulator, but this happens very often. 😞

robin-pham commented 2 months ago

hmm I tried

adb kill-server
adb start-server

and it fixed it for local development, lemme know if it fixes anyone elses

Haven't found a solution yet for CI despite using API 32

julianD77 commented 1 week ago

The solution detailed https://github.com/mobile-dev-inc/maestro/issues/1570#issuecomment-2425935936 also helped us get beyond this issue - just increase the memory of the AVD