Skip to content

Conversation

@jwajgelt
Copy link
Contributor

Fixes a 30s delay after starting maestro tests and before the app is launched on the device.
The delay was caused by maestro calling applesimutils utility in order to set permissions on the device. The utility does not support passing simulator device sets (and even if it did, maestro would not set it anyway), so it would repeatedly try to set permissions on a simulator device which does not exist, and timeout after 30s, after which maestro would proceed with running the application to be tested.

The solution allows applesimutils to modify the permissions on Radon simulator by symlinking it to the CoreSimulator directory -- since applesimutils accesses the simulator's files directly (without checking the simulators database, like xcodebuild), a symlink is sufficient for it to function.

How Has This Been Tested:

  • run maestro test on an iOS simulator
  • the test should start soon after the Maestro TestRunner opens

How Has This Change Been Documented:

Bugfix

@jwajgelt jwajgelt requested a review from filip131311 December 10, 2025 09:30
@jwajgelt jwajgelt self-assigned this Dec 10, 2025
@vercel
Copy link

vercel bot commented Dec 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
radon-ide Ready Ready Preview Comment Dec 10, 2025 9:38am

@jwajgelt jwajgelt force-pushed the @jwajgelt/fix_maestro_ios_delay branch from 924a7ae to a8cae4a Compare December 10, 2025 09:38
@filip131311 filip131311 changed the title fix: delay before starting metro tests fix: delay before starting maestro tests Dec 10, 2025
Copy link
Collaborator

@filip131311 filip131311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have questions inline and another here:

We observed a problem with the permissions script only at the beginning of the test suite run. Is it because of our example tests or is it something normal? If it is only an issue with the setup could we detect that this part of the process is done and clean up the sim links then? this way we could minimize the risk of leaving symlinks behind

} catch (e) {}
const id = this.device.id;
const devicePath = path.join(getOrCreateDeviceSet(id), id);
const coreSimulatorPath = path.join(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it always the same even for users with beta versions of the Xcode? shouldn't we really on xcode-select or something like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not stored within XCode, it's in your Library path.
This path was taken from applesimutils implementation so even if the system decided to place the sims somewhere else, for applesimutils to work we need to link them here.

this.maestroProcess = undefined;
}

public async stopMaestroTest(): Promise<void> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does it not cleanup simlinks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would it?
Stopping the process will make the maestroProcess "promise" reject, triggering the finally clause set up in start.
You should cleanup wherever you initialize the resource, where possible.

@jwajgelt
Copy link
Contributor Author

I have questions inline and another here:

We observed a problem with the permissions script only at the beginning of the test suite run. Is it because of our example tests or is it something normal? If it is only an issue with the setup could we detect that this part of the process is done and clean up the sim links then? this way we could minimize the risk of leaving symlinks behind

  • You can run multiple tests with a single invocation of the maestro command, so you would need to create and cleanup the symlink repeatedly in that case
  • We would need to watch the debug output of the maestro runner, parse it, and understand when the output indicates the util has already run, which I doubt the maestro developers consider a part of the API and might break at any moment

I wouldn't overthink this. If the symlink causes issues, it will cause them regardless if we keep it for the 15 seconds it takes maestro to set up, or the 30 seconds it takes it to run the tests to completion.

Copy link
Collaborator

@filip131311 filip131311 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concerns were misplaced

@jwajgelt jwajgelt merged commit d2e0643 into main Dec 10, 2025
9 checks passed
@jwajgelt jwajgelt deleted the @jwajgelt/fix_maestro_ios_delay branch December 10, 2025 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants