maestro icon indicating copy to clipboard operation
maestro copied to clipboard

Allow retrying on "Operation timed out"

Open d4rky-pl opened this issue 7 months ago • 6 comments

Use case

When opening a deep link to the app that still didn't finish fully loading (e.g. because CI is slow), it may sometimes/often fail with the following error:

com.github.michaelbull.result.UnwrapException: kotlin.Unit java.lang.IllegalStateException: An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=60):01:23
Simulator device failed to open exp+helpling-customer://expo-development-client/?url=http%3A%2F%2F192.168.64.2%3A8081.01:23
Operation timed out01:23
Underlying error (domain=NSPOSIXErrorDomain, code=60):01:23
	The operation couldn’t be completed. Operation timed out01:23
	Operation timed out01:23
 01:23
	at maestro.drivers.IOSDriver$openLink$1.invoke(IOSDriver.kt:589)01:23
	at maestro.drivers.IOSDriver$openLink$1.invoke(IOSDriver.kt:435)01:23
	at maestro.utils.Metrics.measured(Metrics.kt:48)01:23
	at maestro.drivers.IOSDriver.openLink(IOSDriver.kt:435)01:23
	at maestro.Maestro.openLink(Maestro.kt:489)01:23
	at maestro.orchestra.Orchestra.openLinkCommand(Orchestra.kt:878)01:23
	at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:308)01:23
	at maestro.orchestra.Orchestra.executeSubflowCommands(Orchestra.kt:772)01:23
	at maestro.orchestra.Orchestra.runSubFlow(Orchestra.kt:826)01:23
	at maestro.orchestra.Orchestra.runFlowCommand(Orchestra.kt:671)01:23
	at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:316)01:23
	at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:212)01:23
	at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:143)01:23
	at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:189)01:23
	at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:71)01:23
	at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:62)01:23
	at maestro.cli.runner.TestRunner.runCatching(TestRunner.kt:179)01:23
	at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:62)01:23
	at maestro.cli.runner.TestRunner.runSingle$default(TestRunner.kt:42)01:23
	at maestro.cli.command.RecordCommand$call$1.invoke(RecordCommand.kt:136)01:23
	at maestro.cli.command.RecordCommand$call$1.invoke(RecordCommand.kt:114)01:23
	at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:126)01:23
	at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:63)01:23
	at maestro.cli.command.RecordCommand.call(RecordCommand.kt:114)01:23
	at maestro.cli.command.RecordCommand.call(RecordCommand.kt:40)01:23
	at picocli.CommandLine.executeUserObject(CommandLine.java:1953)01:23
	at picocli.CommandLine.access$1300(CommandLine.java:145)01:23
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)01:23
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)01:23
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)01:23
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)01:23
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)01:23
	at maestro.cli.DisableAnsiMixin$Companion.executionStrategy(DisableAnsiMixin.kt:22)01:23
	at picocli.CommandLine.execute(CommandLine.java:2078)01:23
	at maestro.cli.AppKt.main(App.kt:154)

Proposal

Add an optional retry mechanism for those timeouts for when it's clear that the operation may take longer because the app is not ready yet

Anything else?

No response

d4rky-pl avatar May 22 '25 07:05 d4rky-pl

What's the timeout here? Is it that the OS couldn't process the open link instruction because the Expo app wasn't fully metro'd up yet?

Fishbowler avatar Oct 12 '25 21:10 Fishbowler

Would love a way to reproduce this

Fishbowler avatar Oct 12 '25 21:10 Fishbowler

@d4rky-pl Any thoughts on how we'd reproduce this / test if we'd fixed it?

Fishbowler avatar Nov 27 '25 20:11 Fishbowler

@Fishbowler hello and sorry for no reply, I kind of gave up on Maestro due to #1609 so I stopped checking notifications from this repository.

The problem was consistently happening on a resource starved CI machine (Semaphore CI). I'm not sure how to prepare a reliable repro but it was happening with an app using expo dev build and opening a deep link that tried to load the manifest from specific URL while the expo start in dev mode was running in the background.

d4rky-pl avatar Nov 28 '25 18:11 d4rky-pl

I suspect that running a Simulator and a JVM and doing some e2e tests between them might simply be unstable or impossible in a resource starved environment...

Fishbowler avatar Nov 28 '25 19:11 Fishbowler