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

Maestro fails to launch when running from a cron job #1645

Closed
jacobsapps opened this issue Jan 5, 2024 · 4 comments
Closed

Maestro fails to launch when running from a cron job #1645

jacobsapps opened this issue Jan 5, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@jacobsapps
Copy link

I'm using a self-hosted mac mini to run our automation flows. It's got a cron job set up every hour, import the zsh environment, and (for now) have the full file-path in the cron (i.e. running /Users/jacob/.maestro/bin/maestro test myflow.yaml)

Unfortunately, the iOS driver doesn't start up.

Here's the full log output from my shell script:

Running on iPhone 15 - iOS 17.2 - B9E02FE1-2CF8-4CB1-88F4-7F9C8B42B558

maestro.MaestroDriverStartupException$IOSDriverTimeoutException: Maestro iOS driver did not start up in time
    at maestro.drivers.IOSDriver.awaitLaunch(IOSDriver.kt:476)
    at maestro.drivers.IOSDriver.open(IOSDriver.kt:65)
    at maestro.Maestro$Companion.ios(Maestro.kt:585)
    at maestro.cli.session.MaestroSessionManager.createIOS(MaestroSessionManager.kt:309)
    at maestro.cli.session.MaestroSessionManager.createMaestro(MaestroSessionManager.kt:154)
    at maestro.cli.session.MaestroSessionManager.access$createMaestro(MaestroSessionManager.kt:49)
    at maestro.cli.session.MaestroSessionManager$newSession$session$1.invoke(MaestroSessionManager.kt:82)
    at maestro.cli.session.MaestroSessionManager$newSession$session$1.invoke(MaestroSessionManager.kt:81)
    at maestro.cli.db.KeyValueStore.withExclusiveLock(KeyValueStore.kt:37)
    at maestro.cli.session.SessionStore.withExclusiveLock(SessionStore.kt:74)
    at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:81)
    at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:58)
    at maestro.cli.command.TestCommand.call(TestCommand.kt:136)
    at maestro.cli.command.TestCommand.call(TestCommand.kt:46)
    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:2159)
    at maestro.cli.DisableAnsiMixin$Companion.executionStrategy(DisableAnsiMixin.kt:22)
    at picocli.CommandLine.execute(CommandLine.java:2058)
    at maestro.cli.AppKt.main(App.kt:117) 

I've set the MAESTRO_DRIVER_STARTUP_TIMEOUT arbitrarily high but this has no effect.

Previously in the shell script, I use git and xcodebuild to get an iPhone 15 booted with the latest code built to it.

Thanks for any help you can give!

@jacobsapps jacobsapps added the bug Something isn't working label Jan 5, 2024
@jacobsapps
Copy link
Author

A silly but effective workaround I used if anyone has the same issue;

#!/bin/bash

while true; do
    source maestro-script.sh
    sleep 3600
done

@camoles
Copy link

camoles commented Jan 16, 2024

I have automation working for something similar, and what I do is I use simctl boot to start a simulator and then simply sleep 10 to ensure it is started, before I call maestro.

@bartekpacia
Copy link
Contributor

Hey, this looks like a duplicate of #1585

If you experience this problem, please give thumbs-up on #1585

@bartekpacia bartekpacia closed this as not planned Won't fix, can't repro, duplicate, stale Aug 15, 2024
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 Aug 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants