mobile-dev-inc / maestro

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

Maestro iOS/Android driver startup failures #1776

Closed prasanta-biswas closed 2 months ago

prasanta-biswas commented 3 months ago

Describe the bug Maestri iOS driver fails to start when flows are run in parallel using the shards parameter. This is happening very frequently.

To Reproduce Run multiple flows in parallels using shards param > 3 and having more than 3 simulator running

  1. Start three simulators/emulators
  2. Run maestro test flows/ --shards=3
  3. The Flow fails during maestro iOS/Android driver startup

Expected behavior It should successfully start tests on all three simulators/emulators

Environment information (please complete the following information):

Stacktrace kotlinx.coroutines.JobCancellationException: BlockingCoroutine is cancelling; job=BlockingCoroutine{Cancelling}@16391dcb Caused by: maestro.MaestroDriverStartupException$IOSDriverTimeoutException: Maestro iOS driver did not start up in time at maestro.drivers.IOSDriver.awaitLaunch(IOSDriver.kt:494) at maestro.drivers.IOSDriver.open(IOSDriver.kt:64) at maestro.Maestro$Companion.ios(Maestro.kt:610) at maestro.cli.session.MaestroSessionManager.createIOS(MaestroSessionManager.kt:329) at maestro.cli.session.MaestroSessionManager.createMaestro(MaestroSessionManager.kt:162) at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:87) at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:58) at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1.invokeSuspend(TestCommand.kt:245) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

prasanta-biswas commented 3 months ago

@sdfgsdfgd please take a look at this

prasanta-biswas commented 3 months ago

iOS driver failure got resolved after building the maestro-driver-ios.xcodeproj separately. Android issue is still reproducible.

sdfgsdfgd commented 3 months ago

just wait for the next release, you're probably doing something wrong with the server or CLI rebuild on your codebase.

there is nothing wrong with sharding lol

edit: there were some extra steps involving android side's complete rebuild, including the android servers rebuild etc

prasanta-biswas commented 3 months ago

You might be right 😁

bartekpacia commented 2 months ago

Hey guys, thanks for taking time to create the issue and share knowledge.

From what I understand, rebuilding the binaries (both for Android and iOS) fixed the issue, right? If yes then can we close it?

prasanta-biswas commented 2 months ago

@bartekpacia yes it is fixed. You can close the issue.

github-actions[bot] commented 2 months ago

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!