Creating session takes over 5 minutes now with Xcode 9

Hi,
App under test recently added support for iOS 11. App now builds using Xcode 9 and I’ve updated Appium to 1.7.1. When running the test against a simulator, for some reason it takes much longer to run now. From looking at the server log, it appears that POST /session takes over 5 minutes long. Here’s a portion of the server log:

[debug] [XCUITest] WebDriverAgent running on ip '192.168.29.140'
[debug] [XCUITest] WebDriverAgent successfully started after 18043ms
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1506813380923 (16:16:20 GMT-0700 (PDT))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.acorns.AcornsSTG","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[debug] [JSONWP Proxy] Got response with status 200: {"value":{"sessionId":"8247C4CB-20CE-4797-8644-B08B7B55436C","capabilities":{"device":"iphone","browserName":null,"sdkVersion":"10.3.1","CFBundleIdentifier":null}},"sessionId":"8247C4CB-20CE-4797-8644-B08B7B55436C","status":0}
[debug] [BaseDriver] Event 'wdaSessionStarted' logged at 1506813702439 (16:21:42 GMT-0700 (PDT))

Please advise.

Thanks,
Alvin

Hi, I have the same problem. Do you have any solution about that??

Logs:

[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1507038708604 (08:51:48 GMT-0500 (-05))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[debug] [JSONWP Proxy] Got response with status 200: "{\n  \"value\" : {\n    \"state\" : \"success\",\n    \"os\" : {\n      \"name\" : \"iOS\",\n      \"version\" : \"10.3.1\"\n    },\n    \"ios\" : {\n      \"simulatorVersion\" : \"10.3.1\",\n      \"ip\" : \"10.130.10.44\"\n    },\n    \"build\" : {\n      \"time\" : \"Oct  3 2017 08:33:20\"\n    }\n  },\n  \"sessionId\" : \"D7DF7FB8-CD87-4B19-BF36-90D798800BDD\",\n  \"status\" : 0\n}"
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.xxx.xxxxx.xxx","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[debug] [JSONWP Proxy] Got response with status 200: {"value":{"sessionId":"190724E3-4D83-4BF2-8859-2C96BB794216","capabilities":{"device":"iphone","browserName":null,"sdkVersion":"10.3.1","CFBundleIdentifier":null}},"sessionId":"190724E3-4D83-4BF2-8859-2C96BB794216","status":0}
[debug] [BaseDriver] Event 'wdaSessionStarted' logged at 1507039030724 (08:57:10 GMT-0500 (-05))

Regards

how about real devices? I’m testing with 1.7.0 on ios11 real devices and not seeing that, usually takes 12 or 15 seconds or thereabouts for me

Looking more closely at the server logs, the next line is:
[debug] [XCUITest] Cannot find a match for DerivedData folder path from lsof. Trying to access logs
Apparently it’s been reported here: https://github.com/appium/appium/issues/9273. I’ve tried following the solutions suggested but still have the problem. Mauricio, perhaps you or someone else can try.

Ken, I’ve never tried on a real device locally, although running the test against a real device on TestObject seemed fine.

My problem is solved by adding this capability:
waitForQuiescence = false

1 Like

waitForQuiescence = false solved my problem with speed too. Ty @alvy54

Thank you @alvy54. It works for me