Skip to content
This repository has been archived by the owner on Dec 26, 2019. It is now read-only.

Very slow to start interacting after the WDA Runner is installed #1047

Closed
sasasa42 opened this issue Dec 20, 2018 · 8 comments
Closed

Very slow to start interacting after the WDA Runner is installed #1047

sasasa42 opened this issue Dec 20, 2018 · 8 comments

Comments

@sasasa42
Copy link

The problem
When I run the automation script, after the WebDriverAgentRunner is installed, appium takes around one minute to start interacting with the app.

Environment
Appium version (or git revision) that exhibits the issue: 1.11.0-beta.0
Last Appium version that did not exhibit the issue (if applicable): 1.9.0
Desktop OS/version used to run Appium: mac
Node.js version (unless using Appium.app|exe): 8.11.1
Mobile platform/version under test: iOS 12.1.1
Real device or emulator/simulator: Real Device
Appium CLI or Appium.app|exe: Appium CLI
Details
Earlier, when I was on Appium 1.9.0 and XCode 9.4.1 i did not face the issue. But after switching to XCode 10.1 and Appium 1.11.0, I started seeing there is so much of a delay in starting and interacting

Link to Appium logs
https://gist.github.com/sasasa42/bd293b05af6c1de750c6bd6ebe746440

@notihs
Copy link

notihs commented Jan 2, 2019

Related to #1013

@notbobutah
Copy link

notbobutah commented Feb 13, 2019

I am also seeing this problem,
The problem
When I run the automation script, after the WebDriverAgentRunner is installed, appium does not interacting with the app without timing out. No tests were run during the timeout failure.

I see a Promise Timeout in the log file of the failed run that reads:

Error Domain=com.apple.XCTestErrorDomain Code=1000 "Timeout waiting for fulfillment of promise for 'Fetching attributes for Device system-wide element'." UserInfo={NSLocalizedDescription=Timeout waiting for fulfillment of promise for 'Fetching attributes for Device system-wide element'.} /Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgentRunner/UITestingUITests.m 37 1

Environment
Appium version (or git revision) that exhibits the issue: Version 1.10.0 (1.10.0.20181230.2) mac desktop
Last Appium version that did not exhibit the issue (if applicable): 1.9.0
Desktop OS/version used to run Appium: mac desktop Version 1.10.0 (1.10.0.20181230.2)
Node.js version (unless using Appium.app|exe): 10.7.0
Mobile platform/version under test: iOS 12.1.1
Real device or emulator/simulator: Simulator
Appium CLI or Appium.app|exe: Appium Desktop
Details
The delay seems infinite as I have let a test run for up to an hour without it executing tests
I rebuild the WDA and verified it was properly signed, it has deployed and started successfully but has not executed tests until the changes below.

WDA Timeout log reference
https://gist.github.com/notbobutah/cd7550b054f08274668b38569267e363

WDA not timing out, tests running
https://gist.github.com/notbobutah/cba416106fb3f572ea75be7a50c744a4

Setting these Desired caps is the only difference in the above log files:
useNewWDA: true,
waitForQuiescence: false
reduced the wait time to a minute before execution began

Currently I am not stuck and this comment is just additional details to issue 1047

@benzman81
Copy link

Same here. Using Appium 1.11.1 with XCode 9.4.1 starts the test right after the app opens. Changing to XCode 10.1 the test takes always about a minute to start after the app opens. Thats why I thought "wdaLaunchTimeout" is the trick, as it is 60000ms by default. But changing this to 5000 didn't change anything.

@griefie
Copy link

griefie commented Feb 22, 2019

Exactly the same here. Although I noticed that once in a while after i change waitForQuiescence from false to true, it might do a couple of tests without waiting. I have no idea why and it is definitely not always. To me it looks like some timing issue. It would be really great, if one of the contributors would try to reproduce this or at least give us a hit, if we are all doing something wrong...

@griefie
Copy link

griefie commented Mar 5, 2019

it seems that there is a fix for this issue, that one dmissmann has created in the appium xcuitest driver and WDA . He introduces a new capability - wdaEventloopIdleDelay - which will basically add a customizable idling time(or quiesence), because it seems that some devices need a bit longer to idle.

It looks like this will be a part of the next appium release, but if you dont want to wait for it, feel free to get the latest master of appium and replace the xcuitest-driver with the one that he has forked - https://github.com/dmissmann/appium-xcuitest-driver/tree/eventloop_idle_cap

great work dmissmann!

@ghost
Copy link

ghost commented Mar 25, 2019

it seems that there is a fix for this issue, that one dmissmann has created in the appium xcuitest driver and WDA . He introduces a new capability - wdaEventloopIdleDelay - which will basically add a customizable idling time(or quiesence), because it seems that some devices need a bit longer to idle.

It looks like this will be a part of the next appium release, but if you dont want to wait for it, feel free to get the latest master of appium and replace the xcuitest-driver with the one that he has forked - https://github.com/dmissmann/appium-xcuitest-driver/tree/eventloop_idle_cap

great work dmissmann!

I can confirm this worked for me, reducing the time to start the test after app started on the iOS simulator drastically. I uninstalled appium and performed a clean install of appium v1.12.0, then added the wdaEventloopIdleDelay capability with value 3 to my existing capabilities and the issue is gone. Thank you dmissmann!

@AnujDasari
Copy link

@sasasa42 - do you have a resolution or workaround for this?

@sasasa42
Copy link
Author

@sasasa42 - do you have a resolution or workaround for this?

Yes @AnujDasari . The below solution works after updating to the latest appium version and using the "wdaEventloopIdleDelay = 3" desired cap. Thanks @griefie @nenaddrop for updating!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants