maestro icon indicating copy to clipboard operation
maestro copied to clipboard

Receiving the following error on running iOS Maestro tests on Expo Server: Error: Request for viewHierarchy failed, because of unknown reason, body: {"code":"internal","errorMessage":"Unable to perform work on main run loop, process main thread busy for 30.0s"} 29 ❌ Error: BlockingCoroutine is cancelling

Open smehr123 opened this issue 1 year ago • 21 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and didn't find mine.

Steps to reproduce

Hi, when i run my maestro tests locally on iOS Mobile Dev app, it works beautifully but when i run them on Expo server, they all fail with the following exception. Any help would be greatly appreciated. Please Note: Android works fine on Expo server

Actual results

Failing with error -

Error: Request for viewHierarchy failed, because of unknown reason, body: {"code":"internal","errorMessage":"Unable to perform work on main run loop, process main thread busy for 30.0s"} 29 ❌ Error: BlockingCoroutine is cancelling 30 kotlinx.coroutines.JobCancellationException: BlockingCoroutine is cancelling; job=BlockingCoroutine{Cancelling}@1c6682dc 31 Caused by: UnknownFailure(errorResponse=Request for viewHierarchy failed, code: 500, body: {"code":"internal","errorMessage":"Unable to perform work on main run loop, process main thread busy for 30.0s"}) 32 at xcuitest.XCTestDriverClient.handleExceptions(XCTestDriverClient.kt:310) 33 at xcuitest.XCTestDriverClient.processResponse(XCTestDriverClient.kt:258) 34 at xcuitest.XCTestDriverClient.executeJsonRequest(XCTestDriverClient.kt:240) 35 at xcuitest.XCTestDriverClient.viewHierarchy(XCTestDriverClient.kt:72) 36 at ios.xctest.XCTestIOSDevice$viewHierarchy$1.invoke(XCTestIOSDevice.kt:40) 37 at ios.xctest.XCTestIOSDevice$viewHierarchy$1.invoke(XCTestIOSDevice.kt:38) 38 at ios.xctest.XCTestIOSDevice.execute(XCTestIOSDevice.kt:227) 39 at ios.xctest.XCTestIOSDevice.viewHierarchy(XCTestIOSDevice.kt:38) 40 at ios.LocalIOSDevice.viewHierarchy(LocalIOSDevice.kt:47) 41 at maestro.drivers.IOSDriver.viewHierarchy(IOSDriver.kt:152) 42 at maestro.drivers.IOSDriver.access$viewHierarchy(IOSDriver.kt:41) 43 at maestro.drivers.IOSDriver$contentDescriptor$1.invoke(IOSDriver.kt:147) 44 at maestro.drivers.IOSDriver$contentDescriptor$1.invoke(IOSDriver.kt:147) 45 at maestro.drivers.IOSDriver.runDeviceCall(IOSDriver.kt:499) 46 at maestro.drivers.IOSDriver.contentDescriptor(IOSDriver.kt:147) 47 at maestro.ViewHierarchy$Companion.from-8JJjmZI(ViewHierarchy.kt:29) 48 at maestro.utils.ScreenshotUtils$Companion.viewHierarchy-c1iYVAs(ScreenshotUtils.kt:99) 49 at maestro.utils.ScreenshotUtils$Companion.waitForAppToSettle-OpTFbEc(ScreenshotUtils.kt:58) 50 at maestro.drivers.IOSDriver.waitForAppToSettle-5RpGHs4(IOSDriver.kt:429) 51 at maestro.Maestro.waitForAppToSettle-5RpGHs4(Maestro.kt:474) 52 at maestro.Maestro.waitForAppToSettle-5RpGHs4$default(Maestro.kt:469) 53 at maestro.Maestro.screenshotBasedTap-hbl3e4M(Maestro.kt:314) 54 at maestro.Maestro.performTap-hbl3e4M(Maestro.kt:283) 55 at maestro.Maestro.tap-BUbHBYE(Maestro.kt:195) 56 at maestro.orchestra.Orchestra.tapOnElement(Orchestra.kt:777) 57 at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:240) 58 at maestro.orchestra.Orchestra.executeSubflowCommands(Orchestra.kt:605) 59 at maestro.orchestra.Orchestra.runSubFlow(Orchestra.kt:646) 60 at maestro.orchestra.Orchestra.runFlowCommand(Orchestra.kt:514) 61 at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:270) 62 at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:201) 63 at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:111) 64 at maestro.orchestra.Orchestra.runFlow$default(Orchestra.kt:75) 65 at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:185) 66 at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:54) 67 at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:51) 68 at maestro.cli.runner.TestRunner.runCatching(TestRunner.kt:145) 69 at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:51) 70 at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1$1.invoke(TestCommand.kt:291) 71 at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1$1.invoke(TestCommand.kt:249) 72 at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:107) 73 at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:58) 74 at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1.invokeSuspend(TestCommand.kt:249) 75 at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 76 at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) 77 at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111) 78 at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99) 79 at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585) 80 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802) 81 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706) 82 at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)

Expected results

Test should run smoothly on Expo server as they do locally

About app

React Native iOS app Build Tool: Expo Server Tests ran on iPhone 15 - iOS 17.5

About environment

mac Sonoma - 14.6.1 (23G93)

Logs

Running on iPhone 15 - iOS 17.5 - 441BCF51-BE26-4C2A-86FB-437067509B08

Flow Run ${console.log('Starting the flow to access the replay screen')}...Run helpers/signIn.yaml... Run helpers/signIn.yaml... Launch app "com.autograph.fangraph.dev" with clear state... COMPLETED Tap on id: sign-in-btn-id... COMPLETED Assert that "Welcome back to Autograph. Enjoy the latest updates and features." is visible... COMPLETED

Tap on id: email-address-input-id... COMPLETED Wait for animation to end... COMPLETED Take screenshot BeforeEnteringEmail... COMPLETED Run ../java-script-helpers/console.js... COMPLETED ... COMPLETED Take screenshot AfterEnteringEmail... COMPLETED Copy text from element with id: email-address-input-id... COMPLETED Run ../java-script-helpers/console.js... Run flow when "[email protected]" is visible... Run flow when "[email protected]" is visible... Error: Request for viewHierarchy failed, because of unknown reason, body: {"code":"internal","errorMessage":"Unable to perform work on main run loop, process main thread busy for 30.0s"} ❌ Error: BlockingCoroutine is cancelling kotlinx.coroutines.JobCancellationException: BlockingCoroutine is cancelling; job=BlockingCoroutine{Cancelling}@1c6682dc Caused by: UnknownFailure(errorResponse=Request for viewHierarchy failed, code: 500, body: {"code":"internal","errorMessage":"Unable to perform work on main run loop, process main thread busy for 30.0s"}) at xcuitest.XCTestDriverClient.handleExceptions(XCTestDriverClient.kt:310) at xcuitest.XCTestDriverClient.processResponse(XCTestDriverClient.kt:258) at xcuitest.XCTestDriverClient.executeJsonRequest(XCTestDriverClient.kt:240) at xcuitest.XCTestDriverClient.viewHierarchy(XCTestDriverClient.kt:72) at ios.xctest.XCTestIOSDevice$viewHierarchy$1.invoke(XCTestIOSDevice.kt:40) at ios.xctest.XCTestIOSDevice$viewHierarchy$1.invoke(XCTestIOSDevice.kt:38) at ios.xctest.XCTestIOSDevice.execute(XCTestIOSDevice.kt:227) at ios.xctest.XCTestIOSDevice.viewHierarchy(XCTestIOSDevice.kt:38) at ios.LocalIOSDevice.viewHierarchy(LocalIOSDevice.kt:47) at maestro.drivers.IOSDriver.viewHierarchy(IOSDriver.kt:152) at maestro.drivers.IOSDriver.access$viewHierarchy(IOSDriver.kt:41) at maestro.drivers.IOSDriver$contentDescriptor$1.invoke(IOSDriver.kt:147) at maestro.drivers.IOSDriver$contentDescriptor$1.invoke(IOSDriver.kt:147) at maestro.drivers.IOSDriver.runDeviceCall(IOSDriver.kt:499) at maestro.drivers.IOSDriver.contentDescriptor(IOSDriver.kt:147) at maestro.ViewHierarchy$Companion.from-8JJjmZI(ViewHierarchy.kt:29) at maestro.utils.ScreenshotUtils$Companion.viewHierarchy-c1iYVAs(ScreenshotUtils.kt:99) at maestro.utils.ScreenshotUtils$Companion.waitForAppToSettle-OpTFbEc(ScreenshotUtils.kt:58) at maestro.drivers.IOSDriver.waitForAppToSettle-5RpGHs4(IOSDriver.kt:429) at maestro.Maestro.waitForAppToSettle-5RpGHs4(Maestro.kt:474) at maestro.Maestro.waitForAppToSettle-5RpGHs4$default(Maestro.kt:469) at maestro.Maestro.screenshotBasedTap-hbl3e4M(Maestro.kt:314) at maestro.Maestro.performTap-hbl3e4M(Maestro.kt:283) at maestro.Maestro.tap-BUbHBYE(Maestro.kt:195) at maestro.orchestra.Orchestra.tapOnElement(Orchestra.kt:777) at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:240) at maestro.orchestra.Orchestra.executeSubflowCommands(Orchestra.kt:605) at maestro.orchestra.Orchestra.runSubFlow(Orchestra.kt:646) at maestro.orchestra.Orchestra.runFlowCommand(Orchestra.kt:514) at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:270) at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:201) at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:111) at maestro.orchestra.Orchestra.runFlow$default(Orchestra.kt:75) at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:185) at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:54) at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:51) at maestro.cli.runner.TestRunner.runCatching(TestRunner.kt:145) at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:51) at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1$1.invoke(TestCommand.kt:291) at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1$1.invoke(TestCommand.kt:249) at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:107) at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:58) at maestro.cli.command.TestCommand$handleSessions$1$1$results$1$1.invokeSuspend(TestCommand.kt:249) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104) at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111) at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693) /bin/bash --login -eo pipefail /var/folders/vn/nzbsghpn733f46w61_gbp33r0000gn/T/eas-build/9536a2f7-ffe1-44b4-9cfc-deb539cf5e9f/steps/41f20da3-de32-44f1-b08f-15dcfdbf6858/scripts/e39f8b70-8875-49c1-a443-4b15beeb9181.sh exited with non-zero code: 1

Maestro version

1.37.9

How did you install Maestro?

install script (https://get.maestro.mobile.dev)

Anything else?

No response

smehr123 avatar Aug 28 '24 21:08 smehr123

Hey, thanks for creating this issue! Unfortunately, it's not reproducible to us.

Please provide a minimal, reproducible example that clearly explains how to reproduce the problem with the detailed, step-by-step instructions (that can be easily run by me or other maintainers).

This issue does not contain such an example, therefore if more accurate reproduction steps aren't provided, we'll have to reluctantly close it.

If you don't have time to do it right now, that's totally OK. Feel free to open a new issue in the future with all the required information provided.

bartekpacia avatar Aug 28 '24 21:08 bartekpacia

Hi, I am attaching the Expo Server Maestro log that contains the details maestro_log.zip

Also here are the test steps

appId: com.autograph.fangraph.dev
---
- runFlow:
    file: helpers/signIn.yaml
    env:
      EMAIL: '[email protected]'
      VERIFICATION_CODE: '$$$$'
- extendedWaitUntil:
    visible:
      id: 'inbox-tab-id'
    timeout: 10000 # Timeout in milliseconds
- tapOn:
    id: 'inbox-tab-id'
- copyTextFrom:
    id: 'app-header-title-id'
- assertTrue: ${maestro.copiedText == 'Offers'}
- tapOn:
    id: 'profile-tab-id'
- copyTextFrom:
    id: 'user-name-id'
- assertTrue: ${maestro.copiedText == 'XXXXX'}
- tapOn:
    id: 'chat-tab-id'
- copyTextFrom:
    id: 'chat-header-id'
- assertTrue: ${maestro.copiedText == 'Fannzzzz'}

smehr123 avatar Aug 28 '24 22:08 smehr123

The above flow fails on my machine because I don't have the app com.autograph.fangraph.dev installed.

bartekpacia avatar Aug 28 '24 22:08 bartekpacia

the flow works fine locally on iOS simulator but fail on Expo.

smehr123 avatar Aug 28 '24 22:08 smehr123

Please make sure you understand what a minimal, reproducible example is, and provide one.

bartekpacia avatar Aug 28 '24 22:08 bartekpacia

To provide a reproducible example, we need to share the app binary and other test input details, which we're not comfortable disclosing at the moment. Additionally, setting up Expo on your end will be required, as the test passes locally. I’ve attached the maestro_expo log to the ticket to help with troubleshooting.

We’re still investigating and will provide the reproduction steps as soon as we have them.

smehr123 avatar Aug 28 '24 23:08 smehr123

Gotcha. I understand that you may not want to share an app binary, but for us to fix the problem, we need to reproduce it. Otherwise it's very hard and usually not worth the time investment.

Alternatively, you can debug and submit a PR with a fix yourself.

bartekpacia avatar Aug 28 '24 23:08 bartekpacia

Hey Team is this issue solved , facing this issue not able to reach the simulator using the maestro

VinayR2022 avatar Sep 10 '24 06:09 VinayR2022

Without additional information, we can't resolve this issue. We're therefore reluctantly going to close it.

Feel free to open a new issue with all the required information provided, including a minimal, reproducible sample. When creating a new issue, please make sure to diligently fill out the issue template.

Thank you for your contribution to our open-source community!

github-actions[bot] avatar Sep 12 '24 00:09 github-actions[bot]

Our team is running into the same issue for iOS only on EAS builds - everything works fine for Android or running locally.

After doing some research, it seems like there have been similar reports in Appium and direct XCTest UI tests with no resolution.

I understand the reluctance to begin debugging without a minimal reproducible example, but it seems like none of the bug reporters know how to easily construct one, given that the bug only manifests in complex native apps running Maestro on EAS Build. Any guidance would be appreciated here. I would be willing to spend some time doing so if I knew where to even start.

Instead of prematurely closing issues that are affecting multiple users as "completed", I would appreciate if we could explore other avenues of debugging. For example, is there a simple way to increase the timeout from 30s to 60s or 5min? That could help us gauge whether it's a timeout issue or if something is actually crashing/frozen. Alternatively, if there's a way to get more detailed debugging information like a stack dump, we could provide that to look into.

Thanks for looking into this!

navignaw avatar Sep 12 '24 18:09 navignaw

Hey @navignaw, thanks for chiming in and sharing more info.

Instead of prematurely closing issues that are affecting multiple users as "completed", I would appreciate if we could explore other avenues of debugging.

We have this automation in place to only close issues that have had the waiting for customer response label for more than a week, and then lock them only after 2 weeks. We have limited resources to spend on triage, and prefer to spend them on issues that are high-quality and reproducible – and this one didn't fulfill the second criteria.

You're welcome to create a new issue and mention the closed issue. It's OK.

If you'd like to explore changing the timeout, feel free to do so and share a PR with us. You might want to expose it behind an env var.

bartekpacia avatar Sep 12 '24 19:09 bartekpacia

Thanks @bartekpacia , appreciate the response.

From the stack trace, I see that the IOS driver is executing a POST request with json to /viewHierarchy. Under the hood executeJsonRequest uses the okHttpClient which is already set to a timeout of 100s.

That leads me to believe that the POST request itself is timing out after 30s and returning an error. Unfortunately I have no idea where to find documentation for this POST request, and whether it even accepts JSON parameters for configuring the timeout. Do you have any ideas on how to track this down?

(Let me know if you'd prefer I create a new issue or discussion around this!)

navignaw avatar Sep 13 '24 01:09 navignaw

@bartekpacia it seems like the following RC of maestro does have a fix around this error but its a fix to show the real problem. Any more insights into this? https://github.com/mobile-dev-inc/maestro/blob/main/CHANGELOG.md#Unreleased

smehr123 avatar Sep 18 '24 22:09 smehr123

Hey @smehr123, unfortunately no more insights. I no longer work at @mobile-dev-inc (at least for now! – my internship ended), but @amanjeetsingh150 takes over stuff that was my responsibility.

bartekpacia avatar Sep 18 '24 22:09 bartekpacia

Thank you @bartekpacia @amanjeetsingh150 any help would be greatly appreciated as you can see in the thread above, multiple maestro users are getting impacted by this for iOS.

smehr123 avatar Sep 18 '24 22:09 smehr123

Same issue here, breaks at different points, there is no visible pattern to make it reproducable other than it failing on iOS only

rschattauer avatar Sep 19 '24 08:09 rschattauer

@bartekpacia it seems like the following RC of maestro does have a fix around this error but its a fix to show the real problem. Any more insights into this? https://github.com/mobile-dev-inc/maestro/blob/main/CHANGELOG.md#Unreleased

If you're talking about https://github.com/mobile-dev-inc/maestro/pull/2036 it looks like that change will start showing a stack trace in addition to the "Error: BlockingCoroutine is cancelling" which might help us root cause! Could be worth trying it out in https://github.com/mobile-dev-inc/maestro/releases/tag/cli-1.39.0-dev.2 or waiting for the next published release.

Thanks for all the help @bartekpacia 🫡 hope you enjoyed the internship!

navignaw avatar Sep 19 '24 20:09 navignaw

Thank you @navignaw . One quick question, i deleted the maestro folder from root so as to run the installation script of [1.39.0-dev.2]. The script ran fine but it still returns maestro -v as 1.38.1 Screenshot 2024-09-19 at 1 04 08 PM

smehr123 avatar Sep 19 '24 20:09 smehr123

installation worked using dev.2

smehr123 avatar Sep 19 '24 20:09 smehr123

I'm running maestro inside of EAS build and run into this issue seemingly randomly at different points of the tests. Everything passes locally.

I've tried updating to 1.39.0-dev.2 but the issue persists. Using the latest server image from Expo.

Heres an example stack trace from the output json:

"metadata" : {
    "status" : "FAILED",
    "timestamp" : 1728930243964,
    "duration" : 92867,
    "error" : {
      "errorResponse" : "Request for viewHierarchy failed, code: 500, body: {\"code\":\"internal\",\"errorMessage\":\"Unable to perform work on main run loop, process main thread busy for 30.0s\"}",
      "stackTrace" : [ {
        "classLoaderName" : "app",
        "methodName" : "handleExceptions",
        "fileName" : "XCTestDriverClient.kt",
        "lineNumber" : 307,
        "className" : "xcuitest.XCTestDriverClient",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "processResponse",
        "fileName" : "XCTestDriverClient.kt",
        "lineNumber" : 255,
        "className" : "xcuitest.XCTestDriverClient",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "executeJsonRequest",
        "fileName" : "XCTestDriverClient.kt",
        "lineNumber" : 237,
        "className" : "xcuitest.XCTestDriverClient",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "viewHierarchy",
        "fileName" : "XCTestDriverClient.kt",
        "lineNumber" : 69,
        "className" : "xcuitest.XCTestDriverClient",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "invoke",
        "fileName" : "XCTestIOSDevice.kt",
        "lineNumber" : 41,
        "className" : "ios.xctest.XCTestIOSDevice$viewHierarchy$1",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "invoke",
        "fileName" : "XCTestIOSDevice.kt",
        "lineNumber" : 39,
        "className" : "ios.xctest.XCTestIOSDevice$viewHierarchy$1",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "execute",
        "fileName" : "XCTestIOSDevice.kt",
        "lineNumber" : 228,
        "className" : "ios.xctest.XCTestIOSDevice",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "viewHierarchy",
        "fileName" : "XCTestIOSDevice.kt",
        "lineNumber" : 39,
        "className" : "ios.xctest.XCTestIOSDevice",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "viewHierarchy",
        "fileName" : "LocalIOSDevice.kt",
        "lineNumber" : 47,
        "className" : "ios.LocalIOSDevice",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "viewHierarchy",
        "fileName" : "IOSDriver.kt",
        "lineNumber" : 133,
        "className" : "maestro.drivers.IOSDriver",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "access$viewHierarchy",
        "fileName" : "IOSDriver.kt",
        "lineNumber" : 41,
        "className" : "maestro.drivers.IOSDriver",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "invoke",
        "fileName" : "IOSDriver.kt",
        "lineNumber" : 128,
        "className" : "maestro.drivers.IOSDriver$contentDescriptor$1",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "invoke",
        "fileName" : "IOSDriver.kt",
        "lineNumber" : 128,
        "className" : "maestro.drivers.IOSDriver$contentDescriptor$1",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "runDeviceCall",
        "fileName" : "IOSDriver.kt",
        "lineNumber" : 477,
        "className" : "maestro.drivers.IOSDriver",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "contentDescriptor",
        "fileName" : "IOSDriver.kt",
        "lineNumber" : 128,
        "className" : "maestro.drivers.IOSDriver",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "from-8JJjmZI",
        "fileName" : "ViewHierarchy.kt",
        "lineNumber" : 29,
        "className" : "maestro.ViewHierarchy$Companion",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "viewHierarchy-c1iYVAs",
        "fileName" : "Maestro.kt",
        "lineNumber" : 425,
        "className" : "maestro.Maestro",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "viewHierarchy-c1iYVAs$default",
        "fileName" : "Maestro.kt",
        "lineNumber" : 424,
        "className" : "maestro.Maestro",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "invoke",
        "fileName" : "Maestro.kt",
        "lineNumber" : 454,
        "className" : "maestro.Maestro$findElementWithTimeout$element$1",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "invoke",
        "fileName" : "Maestro.kt",
        "lineNumber" : 453,
        "className" : "maestro.Maestro$findElementWithTimeout$element$1",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "withTimeout",
        "fileName" : "MaestroTimer.kt",
        "lineNumber" : 16,
        "className" : "maestro.utils.MaestroTimer",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "findElementWithTimeout-AE3g2Tc",
        "fileName" : "Maestro.kt",
        "lineNumber" : 453,
        "className" : "maestro.Maestro",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "findElementWithTimeout-AE3g2Tc$default",
        "fileName" : "Maestro.kt",
        "lineNumber" : 447,
        "className" : "maestro.Maestro",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "findElement",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 951,
        "className" : "maestro.orchestra.Orchestra",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "access$findElement",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 73,
        "className" : "maestro.orchestra.Orchestra",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "invoke",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 617,
        "className" : "maestro.orchestra.Orchestra$evaluateCondition$3$result$1",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "invoke",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 615,
        "className" : "maestro.orchestra.Orchestra$evaluateCondition$3$result$1",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "withTimeout",
        "fileName" : "MaestroTimer.kt",
        "lineNumber" : 16,
        "className" : "maestro.utils.MaestroTimer",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "evaluateCondition",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 615,
        "className" : "maestro.orchestra.Orchestra",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "evaluateCondition$default",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 587,
        "className" : "maestro.orchestra.Orchestra",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "invoke",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 535,
        "className" : "maestro.orchestra.Orchestra$repeatCommand$checkCondition$1",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "invoke",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 532,
        "className" : "maestro.orchestra.Orchestra$repeatCommand$checkCondition$1",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "repeatCommand",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 538,
        "className" : "maestro.orchestra.Orchestra",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "executeCommand",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 286,
        "className" : "maestro.orchestra.Orchestra",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "executeSubflowCommands",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 681,
        "className" : "maestro.orchestra.Orchestra",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "runSubFlow",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 722,
        "className" : "maestro.orchestra.Orchestra",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "runFlowCommand",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 581,
        "className" : "maestro.orchestra.Orchestra",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "executeCommand",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 284,
        "className" : "maestro.orchestra.Orchestra",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "executeCommands",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 193,
        "className" : "maestro.orchestra.Orchestra",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "runFlow",
        "fileName" : "Orchestra.kt",
        "lineNumber" : 140,
        "className" : "maestro.orchestra.Orchestra",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "runFlow",
        "fileName" : "TestSuiteInteractor.kt",
        "lineNumber" : 233,
        "className" : "maestro.cli.runner.TestSuiteInteractor",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "runTestSuite",
        "fileName" : "TestSuiteInteractor.kt",
        "lineNumber" : 91,
        "className" : "maestro.cli.runner.TestSuiteInteractor",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "runMultipleFlows",
        "fileName" : "TestCommand.kt",
        "lineNumber" : 385,
        "className" : "maestro.cli.command.TestCommand",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "access$runMultipleFlows",
        "fileName" : "TestCommand.kt",
        "lineNumber" : 63,
        "className" : "maestro.cli.command.TestCommand",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "invoke",
        "fileName" : "TestCommand.kt",
        "lineNumber" : 317,
        "className" : "maestro.cli.command.TestCommand$runShardSuite$2",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "invoke",
        "fileName" : "TestCommand.kt",
        "lineNumber" : 297,
        "className" : "maestro.cli.command.TestCommand$runShardSuite$2",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "newSession",
        "fileName" : "MaestroSessionManager.kt",
        "lineNumber" : 102,
        "className" : "maestro.cli.session.MaestroSessionManager",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "newSession$default",
        "fileName" : "MaestroSessionManager.kt",
        "lineNumber" : 52,
        "className" : "maestro.cli.session.MaestroSessionManager",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "runShardSuite",
        "fileName" : "TestCommand.kt",
        "lineNumber" : 297,
        "className" : "maestro.cli.command.TestCommand",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "access$runShardSuite",
        "fileName" : "TestCommand.kt",
        "lineNumber" : 63,
        "className" : "maestro.cli.command.TestCommand",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "invokeSuspend",
        "fileName" : "TestCommand.kt",
        "lineNumber" : 265,
        "className" : "maestro.cli.command.TestCommand$handleSessions$1$results$1$1",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "resumeWith",
        "fileName" : "ContinuationImpl.kt",
        "lineNumber" : 33,
        "className" : "kotlin.coroutines.jvm.internal.BaseContinuationImpl",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "run",
        "fileName" : "DispatchedTask.kt",
        "lineNumber" : 104,
        "className" : "kotlinx.coroutines.DispatchedTask",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "run",
        "fileName" : "LimitedDispatcher.kt",
        "lineNumber" : 111,
        "className" : "kotlinx.coroutines.internal.LimitedDispatcher$Worker",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "run",
        "fileName" : "Tasks.kt",
        "lineNumber" : 99,
        "className" : "kotlinx.coroutines.scheduling.TaskImpl",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "runSafely",
        "fileName" : "CoroutineScheduler.kt",
        "lineNumber" : 585,
        "className" : "kotlinx.coroutines.scheduling.CoroutineScheduler",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "executeTask",
        "fileName" : "CoroutineScheduler.kt",
        "lineNumber" : 802,
        "className" : "kotlinx.coroutines.scheduling.CoroutineScheduler$Worker",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "runWorker",
        "fileName" : "CoroutineScheduler.kt",
        "lineNumber" : 706,
        "className" : "kotlinx.coroutines.scheduling.CoroutineScheduler$Worker",
        "nativeMethod" : false
      }, {
        "classLoaderName" : "app",
        "methodName" : "run",
        "fileName" : "CoroutineScheduler.kt",
        "lineNumber" : 693,
        "className" : "kotlinx.coroutines.scheduling.CoroutineScheduler$Worker",
        "nativeMethod" : false
      } ]
    }
  }

AdamTyler avatar Oct 14 '24 19:10 AdamTyler

I think this issue is caused due to keyboard. When we use inputText to populate the value of text field it opens the keyboard. I dont know why it is causing this issue. But when i supply the default value and dont use inputText it seem to work

AiDeCoder9 avatar Oct 23 '24 03:10 AiDeCoder9

Same problem, crashing on text input

 Running on iPhone 16 - iOS 18.1 - xxxxxx-xxxxxx-xxxx-xxxxx-xxxxxx
  > On Flow Start
Run setup.yaml...
Launch app "app.xxxx"...Run setup.yaml... RUNNING
 > Flow onboarding
> Flow onboarding
Tap on "Get started"...
COMPLETED
Tap on "2"...
COMPLETED
Input text 2...
COMPLETED
Tap on "Continue"...
COMPLETED
Tap on "Create account"...
COMPLETED
Tap on id: onboarding-create-account-email-input...
Exception in thread "main"
UnknownFailure(errorResponse=Request for viewHierarchy failed, code: 500, body: {"errorMessage":"Unable to perform work on main run loop, process main thread busy for 30.0s","code":"internal"})
	at xcuitest.XCTestDriverClient.handleExceptions(XCTestDriverClient.kt:307)
	at xcuitest.XCTestDriverClient.processResponse(XCTestDriverClient.kt:255)
	at xcuitest.XCTestDriverClient.executeJsonRequest(XCTestDriverClient.kt:237)
	at xcuitest.XCTestDriverClient.viewHierarchy(XCTestDriverClient.kt:69)
	at ios.xctest.XCTestIOSDevice$viewHierarchy$1.invoke(XCTestIOSDevice.kt:41)
	at ios.xctest.XCTestIOSDevice$viewHierarchy$1.invoke(XCTestIOSDevice.kt:39)
	at ios.xctest.XCTestIOSDevice.execute(XCTestIOSDevice.kt:228)
	at ios.xctest.XCTestIOSDevice.viewHierarchy(XCTestIOSDevice.kt:39)
	at ios.LocalIOSDevice.viewHierarchy(LocalIOSDevice.kt:49)
	at maestro.drivers.IOSDriver.viewHierarchy(IOSDriver.kt:134)
	at maestro.drivers.IOSDriver.access$viewHierarchy(IOSDriver.kt:41)
	at maestro.drivers.IOSDriver$contentDescriptor$1.invoke(IOSDriver.kt:129)
	at maestro.drivers.IOSDriver$contentDescriptor$1.invoke(IOSDriver.kt:129)
	at maestro.drivers.IOSDriver.runDeviceCall(IOSDriver.kt:478)
	at maestro.drivers.IOSDriver.contentDescriptor(IOSDriver.kt:129)
	at maestro.ViewHierarchy$Companion.from-8JJjmZI(ViewHierarchy.kt:29)
	at maestro.Maestro.viewHierarchy-c1iYVAs(Maestro.kt:425)
	at maestro.Maestro.viewHierarchy-c1iYVAs$default(Maestro.kt:424)
	at maestro.Maestro$findElementWithTimeout$element$1.invoke(Maestro.kt:454)
	at maestro.Maestro$findElementWithTimeout$element$1.invoke(Maestro.kt:453)
	at maestro.utils.MaestroTimer.withTimeout(MaestroTimer.kt:16)
	at maestro.Maestro.findElementWithTimeout-AE3g2Tc(Maestro.kt:453)
	at maestro.Maestro.findElementWithTimeout-AE3g2Tc$default(Maestro.kt:447)
	at maestro.orchestra.Orchestra.findElement(Orchestra.kt:965)
	at maestro.orchestra.Orchestra.findElement$default(Orchestra.kt:937)
	at maestro.orchestra.Orchestra.tapOnElement(Orchestra.kt:865)
	at maestro.orchestra.Orchestra.executeCommand(Orchestra.kt:255)
	at maestro.orchestra.Orchestra.executeCommands(Orchestra.kt:195)
	at maestro.orchestra.Orchestra.runFlow(Orchestra.kt:129)
	at maestro.cli.runner.MaestroCommandRunner.runCommands(MaestroCommandRunner.kt:179)
	at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:62)
	at maestro.cli.runner.TestRunner$runSingle$result$1.invoke(TestRunner.kt:53)
	at maestro.cli.runner.TestRunner.runCatching(TestRunner.kt:160)
	at maestro.cli.runner.TestRunner.runSingle(TestRunner.kt:53)
	at maestro.cli.command.TestCommand.runSingleFlow(TestCommand.kt:352)
	at maestro.cli.command.TestCommand.access$runSingleFlow(TestCommand.kt:63)
	at maestro.cli.command.TestCommand$runShardSuite$2.invoke(TestCommand.kt:326)
	at maestro.cli.command.TestCommand$runShardSuite$2.invoke(TestCommand.kt:297)
	at maestro.cli.session.MaestroSessionManager.newSession(MaestroSessionManager.kt:103)
	at maestro.cli.session.MaestroSessionManager.newSession$default(MaestroSessionManager.kt:53)
	at maestro.cli.command.TestCommand.runShardSuite(TestCommand.kt:297)
	at maestro.cli.command.TestCommand.access$runShardSuite(TestCommand.kt:63)
	at maestro.cli.command.TestCommand$handleSessions$1$results$1$1.invokeSuspend(TestCommand.kt:265)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)

fendermany avatar Dec 03 '24 17:12 fendermany

Same issue, crashing on text input on EAS server.

appear randomly, mainly fail image

Environment:

maestro version: 1.39.2 iOS device: iPhone 16 (045B9A55-CB39-4981-B960-32239F94A6BB) on com.apple.CoreSimulator.SimRuntime.iOS-18-1 macOS: Sonoma 14.6 Xcode: 16.1 (16B40) Node.js: 18.18.0 Yarn: 1.22.21 fastlane: 2.225.0 CocoaPods: 1.16.2 Ruby: 3.2 node-gyp: 10.2.0

Dependencies

"expo": "~51.0.39" "react-native": "0.74.5"

eas build

custom build

build:
  name: Build and test iOS simulator app
  steps:
    - eas/checkout
    - eas/build
    - eas/maestro_test:
        inputs:
          flow_path: |
            __e2e__/flows/login.yml
            __e2e__/flows/signup.yml

jetaix avatar Dec 06 '24 07:12 jetaix

Same issue, crashing on text input:

Assert that "Login as test user" is visible... COMPLETED Assert that id: test-user-input is visible... Exception in thread "main" UnknownFailure(errorResponse=Request for viewHierarchy failed, code: 500, body: {"errorMessage":"Unable to perform work on main run loop, process main thread busy for 30.0s","code":"internal"})

Any workaround for this?

alexandrumogic avatar Jan 15 '25 10:01 alexandrumogic

Also having this issue

ludvigbartholdsson avatar Jan 26 '25 23:01 ludvigbartholdsson

Hey Team! We're facing the same issue where tests are smoothly passing locally but failing on EAS. Wonder if someone knows if its related to recent maestro versions?

Sukhpreet89 avatar Jan 28 '25 21:01 Sukhpreet89

We are also running into this issue. Trying to setup e2e with an EAS workflow. We get 100% passes running the tests locally but can't get everything to complete when running in EAS's environment. I'm unsure if this has something to do with how EAS test instances are setup or what; but the docs to fix this issue are pretty sparse. @brentvatne I'm wondering if there is someone on the EAS team that could help with this?

erickreutz avatar Jan 31 '25 17:01 erickreutz

Or maybe @kitten could help?

erickreutz avatar Feb 05 '25 15:02 erickreutz

We were able to resolve the issue by adding image: latest to the test job in the EAS Workflow configuration (.eas/workflows/example-workflow.yml)

  e2e-test:
    needs: [build]
    name: Run E2E Tests
    type: maestro
    image: latest # <---- here
    params:
      build_id: ${{ needs.build.outputs.build_id }}
      flow_path: ./maestro/example-flow.yml

1kuko3 avatar Feb 10 '25 17:02 1kuko3

This does not work for us

mån 10 feb. 2025 kl. 18:58 skrev Jakub Hanko @.***>:

We were able to resolve the issue by adding image: latest to the test job in the EAS Workflow configuration (.eas/workflows/example-workflow.yml)

e2e-test: needs: [build] name: Run E2E Tests type: maestro image: latest # <---- here params: build_id: ${{ needs.build.outputs.build_id }} flow_path: ./maestro/example-flow.yml

— Reply to this email directly, view it on GitHub https://github.com/mobile-dev-inc/Maestro/issues/1967#issuecomment-2648822117, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKT3Q6BYQWPBWRYJZNSIW332PDSC7AVCNFSM6AAAAABNJCUGNOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNBYHAZDEMJRG4 . You are receiving this because you commented.Message ID: @.***>

ludvigbartholdsson avatar Feb 10 '25 17:02 ludvigbartholdsson