-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
WDA session stuck 20s at first try and fails, then, after retry it works #15101
Comments
Could you give us with If the first |
Thank you for the quick response @KazuCocoa Please find the logs with showIOSLog and logs with showIOSLog+showXcodeLog added into the "Links to Appium logs" section of the description. |
Thanks.
Could you try to call
Then, the URL returns the result of screen size against springboard (default home app). As a note, my devices (iPhone SE, SE 2nd x iOS 14.3 and 14.4) has no such delay so far. |
@KazuCocoa I saw such delays when WDA was trying to access elements of |
appium/WebDriverAgent#467 might help there |
Hi @mykola-mokhnach it was tested on commit f8b2aaee362fda7959a0f7812838211d8dc3217c (HEAD -> system_app, origin/system_app) please results here system_app_f8b2aaee36.log Hi @KazuCocoa, thanks for the suggestion, unfortunately I am getting trouble with building
the result is
The phone is iphone7, XCode 12.4 (12D4e) |
Could you please say at which line in that log the delay happens? I only see two calls to /wda/screen there and they were pretty fast |
Actually, found it. I assume the delay is caused by the test daemon, which is unable to get the snapshot of the system app and performs multiple retries to mitigate that:
I'm afraid only Apple could fix that. Also, I'm unable to reproduce the issue locally, which means it may only happen under particular circumstances. |
Is there a test scenario which can help to isolate the case? Is there a way to delay the "getting the snapshot of the system app", maybe that can help? An additional information:
the moment when Postman receives data from this request http://127.0.0.1:8100/session/F40EC766-1C89-4365-A094-E20033988869/wda/screen
|
On top of the fact that XCTest fails to fetch the status bar data it would be interesting to know why:
@KazuCocoa @jlipps Maybe you have some answers? |
oh, the |
Probably to behave as same as Android? I forget (or I do not know) about the discussion in a PR or somewhere, but probably Android also returns the same viewpoint in the session endpoint. I agree with which could be called independently when needed?. We know have |
Hi @KazuCocoa, Result is the same, the request freezes exactly 1 minute, then returns the content. Please see also the video recording - https://github.com/uterator/Q4erqFMx3n/blob/master/issues_15101_480.mov |
Thanks. Hm, it seems the root cause is inside XCTest framework... The code just gets an element via it... As #15101 (comment) , the only thing we can do in Appium side is remove |
how about appium/appium-xcuitest-driver#1278 ? |
Thanks @KazuCocoa for the commit, the results are good. My setup is
With includeScreenInfoInSession = false. Without setting "includeScreenInfoInSession". Thank you very much! |
The name was changed to appium:includeDeviceCapsToSessionInfo, but you can try it out with current |
The problem
At running a test, the WDA is being installed and run, the app is open on the iPhone but nothing happens about 20s.
Then, after auto-restart of the WDA session, everything works fine.
When the WDA session is stuck, I do request to the WDA using Postman, postman shows pending response until the 20s is reached, then it returns correct data.
Seems WDA is busy for 20s at first try, then, after that busy session is terminated and the new one is started as wdaStartupRetries=3, that second session works normal.
Same happens at Appium Desktop run, first time opening a connection, the Inspector is unable to load the content and the screenshot, but when I kill the session and start again, it works normally.
Environment
Details
First session logs which show the WDA stuck moment
You see time jump from 20:38:35 to 20:38:59
During that 24 seconds the app did nothing, it was on the first page.
WDA could not response to GET http://127.0.0.1:8106/session/0E449474-55C0-42B8-BFE6-850C87F52221/wda/screen
The next line was
Second session logs which show the WDA responded correcly
You see there is no time jump
the WDA was able to response to GET http://127.0.0.1:8106/session/E4066E22-82A9-4EF1-963C-A5A81D19D400/wda/screen
The return was
UPDATE
When the WDA is stuck at the first run, the app isn't hang, I can click and work on it.
Links to Appium logs
first_WDA_stuck.log
fist_page_ios_stuck_SHOW_IOS_LOG
fist_page_ios_stuck_SHOW_IOS_LOG__SHOW_XCODE_LOG
The text was updated successfully, but these errors were encountered: