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

[v1.36.0] Got Error: Unable to establish a connection to the XCUITest server #1802

Open
yobelioekaharja opened this issue Jul 15, 2024 · 15 comments
Labels
bug Something isn't working

Comments

@yobelioekaharja
Copy link

yobelioekaharja commented Jul 15, 2024

Describe the bug
I tried to run my test in iOS using maestro. The flow is:

  1. Open a deeplink
  2. Assert the page opened successfully
  3. Tap on some menu
  4. Swipe the screen 3 times
  5. Assert some section displayed
  6. etc...

I got 2 problems here:

  1. After run the maestro test flow.yaml (flow.yaml is my yaml file for the iOS flow), I experience slowness on iOS to start the test. It seems that maestro tried to reinstall its maestro-driver and sometimes not successfully. I used to kill my simulator, reopen the simulator, and run the test again. Then the maestro-driver can installed properly. Nevertheless, to start the first step of my test (opening the deeplink) still takes long time
  2. When the maestro start my test flow, at some point, it got error log (attached in the picture below). This error log comes randomly. Sometimes it comes when the code try to tap menu, sometimes it comes when the code try to swap the screen. The error Retrying connection to the XCUITest server for... happened but didn't make my test failed at all. After I wait for a while, my test can successfully continue to run the next steps. But, this error log comes again and again. This makes my test takes very long time to run and not finished yet until I kill my terminal who run the maestro test. Even after the test successfully continue after got the Retrying connection..., but in the end my test still cannot run successfully until the end flow. Even though the error said that Unable to establish a connection to the XCUITest server... and because of XCUITest server got crashed/exit..., but I am sure that my internet connection is still connected, the simulator not hang, and my app also still opened.

To Reproduce
Steps to reproduce the behavior:

  1. Start the simulator
  2. Run maestro test flow.yaml
  3. The Flow fails in the middle of my test

Expected behavior
The expected behavior is maestro can successfully execute my command like tapOn, swipe, etc. Besides that, my test should can finished successfully. Either it will passed or failed.

Screenshots
Screenshot 2024-07-15 at 17 08 23

Environment information (please complete the following information):

  • Maestro version: 1.36.0
  • Platform: iOS 15.0, Xcode 15.3
  • Framework: iOS
  • Device model and OS version: iPhone 11
  • Simulator, emulator or physical device: Simulator
  • Host [e.g. Mac M1, Windows, Linux, etc]: Mac M1

Additional context
For additional context:
I run my test case with a good internet connection. The apps also opened successfully. The simulator still running and not hang.

@yobelioekaharja yobelioekaharja added the bug Something isn't working label Jul 15, 2024
@bartekpacia
Copy link
Contributor

Hi, thanks for taking time to create this detailed issue, and sorry about the problem.

Could you please share the flow and app binary? otherwise it's hard to debug.

@bartekpacia bartekpacia added the waiting for customer response More information is needed from the customer before we can progress on the issue label Jul 16, 2024
@yobelioekaharja
Copy link
Author

yobelioekaharja commented Jul 16, 2024

Sorry, I cannot share the app because it is my company's internal app.
Update for this case:
Previously I use Xcode 13.3 and got this issue. Then I upgraded mine into Xcode 15.3, this issue still happened. But somehow I managed to solve this by following this guide. Nevertheless, I still curious and don't know why there are some unfinished iOS driver maestro process. In summary, killing all the unfinished process can help me

Additional info: I also ask my friend to try this case. He use the same simulator, but use different Xcode version (still using Xcode 13.3). Even after killing all unfinished process, the issue still replicable for him (with Xcode 13.3).

@github-actions github-actions bot removed the waiting for customer response More information is needed from the customer before we can progress on the issue label Jul 16, 2024
@emmaarnott
Copy link

emmaarnott commented Jul 17, 2024

I am also having this issue - I am running Xcode 16 beta 3, I see maestro-driver-iosUITests-Runner quit unexpectedly. I've included details and attached screenshots and logs.

Maestro version: 1.36.0
Platform: Xcode 16 beta 3
Framework: iOS
Device model and OS version: iPhone 15 Pro, iOS 17.5
Simulator, emulator or physical device: Simulator
Host [e.g. Mac M1, Windows, Linux, etc]: Mac M2, Sonoma 14.5

CleanShot 2024-07-17 at 11 01 55@2x

maestro.txt

@emmaarnott
Copy link

I am also having this issue - I am running Xcode 16 beta 3, I see maestro-driver-iosUITests-Runner quit unexpectedly. I've included details and attached screenshots and logs.

Maestro version: 1.36.0 Platform: Xcode 16 beta 3 Framework: iOS Device model and OS version: iPhone 15 Pro, iOS 17.5 Simulator, emulator or physical device: Simulator Host [e.g. Mac M1, Windows, Linux, etc]: Mac M2, Sonoma 14.5

CleanShot 2024-07-17 at 11 01 55@2x

maestro.txt

I am not sure if this is helpful, but thought to mention that I have realized that this only happens to me when I try to run a test that involves inputting text. All other tests that just involve taps, scroll etc work fine.

CleanShot 2024-07-29 at 17 08 58@2x

@yobelioekaharja
Copy link
Author

Have you already tried to kill all maestro process before run your test? @emmaarnott
pgrep -lf maestro | awk '{print $1}' | xargs -r kill

@emmaarnott
Copy link

@yobelioekaharja Yeah, I have tried killing all maestro processes then running the test again but it does not help.

@DavidREntwistle
Copy link

This is also an issue on the latest 1.37.4 CLI

@andreped
Copy link

I am not sure if this is helpful, but thought to mention that I have realized that this only happens to me when I try to run a test that involves inputting text. All other tests that just involve taps, scroll etc work fine.

THANK YOU, @emmaarnott! This was extremely helpful for me! Finally I can go to bed...

Omfg, I spent two days on this, just to find that inputText was broken, as well as timeout needed to be increased.

At least I am able to do very simple e2e tests through GitHub Actions now.

Have you found a workaround to get inputText working?

@emmaarnott
Copy link

I am not sure if this is helpful, but thought to mention that I have realized that this only happens to me when I try to run a test that involves inputting text. All other tests that just involve taps, scroll etc work fine.

THANK YOU, @emmaarnott! This was extremely helpful for me! Finally I can go to bed...

Omfg, I spent two days on this, just to find that inputText was broken, as well as timeout needed to be increased.

At least I am able to do very simple e2e tests through GitHub Actions now.

Have you found a workaround to get inputText working?

@andreped Oh, I am so glad to hear that it helped you from going completely insane, I know that feeling all too well 😅 Tbh I didn't try to figure out a workaround as our tests aren't urgent right now, but I just tried to run my test that has inputText in it again, and it works now - so appears to be fixed in the most recent version of maestro?

@andreped
Copy link

andreped commented Aug 23, 2024

@andreped Oh, I am so glad to hear that it helped you from going completely insane, I know that feeling all too well 😅 Tbh I didn't try to figure out a workaround as our tests aren't urgent right now, but I just tried to run my test that has inputText in it again, and it works now - so appears to be fixed in the most recent version of maestro?

@emmaarnott That is interesting! Did you upgrade Maestro in GitHub Actions to latest, or how did it resolve itself? :P

I mean I can run my CI again to see if it is fixed, but we use a fixed version of Maestro in our CIs.

@emmaarnott
Copy link

emmaarnott commented Aug 23, 2024

@andreped Oh, I am so glad to hear that it helped you from going completely insane, I know that feeling all too well 😅 Tbh I didn't try to figure out a workaround as our tests aren't urgent right now, but I just tried to run my test that has inputText in it again, and it works now - so appears to be fixed in the most recent version of maestro?

@emmaarnott That is interesting! Did you upgrade Maestro in GitHub Actions to latest, or how did it resolve itself? :P

I mean I can run my CI again to see if it is fixed, but we use a fixed version of Maestro in our CIs.

@andreped Ah OK - nope, I just updated via terminal this morning by running curl -Ls "https://get.maestro.mobile.dev" | bash So ran that test on version 1.37.9 of the CLI and it's working for me. In saying that, this is the first time I've tried since I initially commented when I was using v1.36.0. We don't use GitHub Actions, we just run the scripts from terminal

@andreped
Copy link

@andreped Ah OK - nope, I just updated via terminal this morning by running curl -Ls "https://get.maestro.mobile.dev" | bash So ran that test on version 1.37.9 of the CLI and it's working for me. In saying that, this is the first time I've tried since I initially commented when I was using v1.36.0. We don't use GitHub Actions, we just run the scripts from terminal

Oh, I see. No, in my case I am seeing this on headless servers (github actions) when I am trying to run tests with maestro.

All works fine for me locally, at least on my macbook with M2 chip - at least with the later versions.

@emmaarnott
Copy link

@andreped Ah OK - nope, I just updated via terminal this morning by running curl -Ls "https://get.maestro.mobile.dev" | bash So ran that test on version 1.37.9 of the CLI and it's working for me. In saying that, this is the first time I've tried since I initially commented when I was using v1.36.0. We don't use GitHub Actions, we just run the scripts from terminal

Oh, I see. No, in my case I am seeing this on headless servers (github actions) when I am trying to run tests with maestro.

All works fine for me locally, at least on my macbook with M2 chip - at least with the later versions.

ah, shame :(

@Lenovis
Copy link

Lenovis commented Aug 25, 2024

I think I'm facing the same issue when trying to use Maestro to interact with the inputText field during an Expo EAS Build. Everything works perfectly when running Maestro locally, but when I run the same setup in EAS Build, the interaction with the input field fails with an error, as shown in the screenshot below:
image

EAS Build Environment: Version 1.37.9 of Maestro is being installed automatically during the build process.

Running locally, everything works fine, but when I try to do it in EAS, this issue happens.

@garymc-MO
Copy link

Seeing exact same as @Lenovis, works fine locally but EAS throws up this error.

Sometimes it seems to recover to a certain extent but then often double enters some of the text, causing the test to fail anyway 😢 :

image

vs the expected text set as an env variable:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants