Appium 1.7.0/Xcode9.0/iOS11: Socket Hangup after several hours of testing

I’ve just recently gone up to 1.7/ios11/Xcode 9, and have some long duration tests running. Essentially:

on an ipad mini 2, running ios11…

Launch youtube
for 24 hours, or until an error do:
randomly tap, swipe, set orientation to portrait or landscape
sleep between 3 and 10 seconds
close youtube

The test proceds fine for 10-12 hours with circa 3400 of those random taps and swipes, until an error occurs. This is the last successful execution of a command for one iteration, followed by the failure. After the command is proxied to the ipad it waits for 2 minutes before returning with no HTTP Errorcode.

2017-09-30 18:31:16:743 - info: [HTTP] --> POST /wd/hub/session/50442b73-7162-4d74-961e-071d0bec564b/orientation {“orientation”:“PORTRAIT”}
2017-09-30 18:31:16:743 - info: [MJSONWP] Driver proxy active, passing request on via HTTP proxy
2017-09-30 18:31:16:743 - info: [debug] [XCUITest] Executing command ‘proxyReqRes’
2017-09-30 18:31:16:744 - info: [debug] [JSONWP Proxy] Proxying [POST /wd/hub/session/50442b73-7162-4d74-961e-071d0bec564b/orientation] to [POST http://localhost:8100/session/340105EB-711E-0-A45C-ABAD7AB94A41/orientation] with body: {“orientation”:“PORTRAIT”}
2017-09-30 18:31:19:324 - info: [debug] [JSONWP Proxy] Got response with status 200: {“value”:{},“sessionId”:“340105EB-711E-4650-A45C-ABAD7AB94A41”,“status”:0}
2017-09-30 18:31:19:324 - info: [JSONWP Proxy] Replacing sessionId 340105EB-711E-4650-A45C-ABAD7AB94A41 with 50442b73-7162-4d74-961e-071d0bec564b
2017-09-30 18:31:19:324 - info: [HTTP] <-- POST /wd/hub/session/50442b73-7162-4d74-961e-071d0bec564b/orientation 200 2581 ms - 74

2017-09-30 18:31:29:890 - info: [HTTP] --> POST /wd/hub/session/50442b73-7162-4d74-961e-071d0bec564b/touch/perform {“actions”:[{“options”:{“x”:400,“y”:100},“action”:“press”},{“options”:{"ms50},“action”:“wait”},{“options”:{“x”:100,“y”:100},“action”:“moveTo”},{“options”:{},“action”:“release”}]}
2017-09-30 18:31:29:890 - info: [debug] [MJSONWP] Calling AppiumDriver.performTouch() with args: [[{“options”:{“x”:400,“y”:100},“action”:“press”},{“options”:{“ms”:250},“action”:“wait”},{“opns”:{“x”:100,“y”:100},“action”:“moveTo”},{“options”:{},“action”:“release”}],“50442b73-7162-4d74-961e-071d0bec564b”]
2017-09-30 18:31:29:890 - info: [debug] [XCUITest] Executing command ‘performTouch’
2017-09-30 18:31:29:891 - info: [debug] [XCUITest] Received the following touch action: press(options={“x”:400,“y”:100})-wait(options={“ms”:250})-moveTo(options={“x”:100,“y”:100})-release(oons={})
2017-09-30 18:31:29:891 - info: [debug] [XCUITest] Found matching gesture: drag
2017-09-30 18:31:29:892 - info: [debug] [JSONWP Proxy] Proxying [POST /wda/dragfromtoforduration] to [POST http://localhost:8100/session/340105EB-711E-4650-A45C-ABAD7AB94A41/wda/dragfromtofuration] with body: {“fromX”:400,“fromY”:100,“toX”:500,“toY”:200,“duration”:0.25}
2017-09-30 18:33:30:470 - info: [HTTP] <-- POST /wd/hub/session/50442b73-7162-4d74-961e-071d0bec564b/touch/perform - - ms - -

and then the closeApp:

2017-09-30 18:33:30:597 - info: [HTTP] --> POST /wd/hub/session/50442b73-7162-4d74-961e-071d0bec564b/appium/app/close {}
2017-09-30 18:33:30:598 - info: [debug] [MJSONWP] Calling AppiumDriver.closeApp() with args: [“50442b73-7162-4d74-961e-071d0bec564b”]
2017-09-30 18:33:30:598 - info: [debug] [XCUITest] Executing command ‘closeApp’
2017-09-30 18:33:39:958 - info: [debug] [XCUITest] Connection to WDA timed out
2017-09-30 18:33:39:958 - info: [debug] [iProxy] recv failed: Operation not permitted
2017-09-30 18:33:39:961 - info: [debug] [JSONWP Proxy] Proxying [DELETE /session/50442b73-7162-4d74-961e-071d0bec564b] to [DELETE http://localhost:8100/session/340105EB-711E-4650-A45C-ABAD7AB94A41] with no body
2017-09-30 18:33:39:962 - error: [MJSONWP] Encountered internal error running command: ProxyRequestError: Could not proxy command to remote server. Original error: Error: socket hang up
at JWProxy.proxy$ (…/…/…/lib/jsonwp-proxy/proxy.js:152:13)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at
2017-09-30 18:33:39:973 - info: [debug] [XCUITest] Unable to DELETE session on WDA: ‘Could not proxy command to remote server. Original error: Error: socket hang up’. Continuing shutdown.
2017-09-30 18:33:39:973 - info: [XCUITest] Shutting down sub-processes
2017-09-30 18:33:39:973 - info: [XCUITest] Shutting down iproxy process (pid 69754)
2017-09-30 18:33:39:975 - info: [debug] [XCUITest] iproxy exited with code ‘null’
2017-09-30 18:33:39:976 - info: [XCUITest] Shutting down xcodebuild process (pid 69775)
2017-09-30 18:33:40:011 - info: [XCUITest] xcodebuild exited with code ‘null’ and signal ‘SIGTERM’
2017-09-30 18:33:40:011 - info: [iOS] Successfully closed the ‘com.google.ios.youtube’ app.
2017-09-30 18:33:40:012 - info: [debug] [MJSONWP] Responding to client with driver.closeApp() result: null
2017-09-30 18:33:40:012 - info: [HTTP] <-- POST /wd/hub/session/50442b73-7162-4d74-961e-071d0bec564b/appium/app/close 200 9415 ms - 76

Interestingly, the 3 instances I have of it failing, occur just after it has done

  • Orientation Landscape
  • Orientation Portrait
  • < FAIL, can be swipe or tap>

However it has done the above sequence many times successfully before failing…

My capabilities for the session are:
2017-09-30 05:34:15:572 - info: [HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“bundleId”:“com.google.ios.youtube”,“useNewWDA”:true,“fullReset”:false,“automationName”:“xcuitest”,“clearSystemFiles”:true,“platformVersion”:“11.0”,“deviceName”:“xx”,“usePrebuiltWDA”:false,“newCommandTimeout”:86400,“preventWDAAttachments”:true,“platformName”:“iOS”,“udid”:“c75…38915”}}
2017-09-30 05:34:15:573 - info: [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“bundleId”:“com.google.ios.youtube”,“useNewWDA”:true,“fullReset”:false,“automationName”:“xcuitest”,“clearSystemFiles”:true,“platformVersion”:“11.0”,“deviceName”:“xx”,“usePrebuiltWDA”:false,“newCommandTimeout”:86400,“preventWDAAttachments”:true,“platformName”:“iOS”,“udid”:“c7…38915”},null,null]
2017-09-30 05:34:15:574 - info: [debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1506746055574 (05:34:15 GMT+0100 (IST))
2017-09-30 05:34:15:576 - info: [Appium] Creating new XCUITestDriver (v2.49.0) session
2017-09-30 05:34:15:576 - info: [Appium] Capabilities:
2017-09-30 05:34:15:578 - info: [Appium] bundleId: ‘com.google.ios.youtube’
2017-09-30 05:34:15:578 - info: [Appium] useNewWDA: true
2017-09-30 05:34:15:578 - info: [Appium] fullReset: false
2017-09-30 05:34:15:579 - info: [Appium] automationName: ‘xcuitest’
2017-09-30 05:34:15:579 - info: [Appium] clearSystemFiles: true
2017-09-30 05:34:15:579 - info: [Appium] platformVersion: ‘11.0’
2017-09-30 05:34:15:581 - info: [Appium] deviceName: ‘xx’
2017-09-30 05:34:15:581 - info: [Appium] usePrebuiltWDA: false
2017-09-30 05:34:15:582 - info: [Appium] newCommandTimeout: 86400
2017-09-30 05:34:15:582 - info: [Appium] preventWDAAttachments: true
2017-09-30 05:34:15:582 - info: [Appium] platformName: ‘iOS’
2017-09-30 05:34:15:582 - info: [Appium] udid: ‘c75…38915’
2017-09-30 05:34:15:709 - info: [BaseDriver] Session created with session id: 50442b73-7162-4d74-961e-071d0bec564b
2017-09-30 05:34:16:738 - info: [debug] [XCUITest] Xcode version set to ‘9.0’ (tools v8.3.2.0.1.1492020469)
2017-09-30 05:34:16:798 - info: [debug] [XCUITest] iOS SDK Version set to ‘11.0’
2017-09-30 05:34:16:798 - info: [debug] [BaseDriver] Event ‘xcodeDetailsRetrieved’ logged at 1506746056798 (05:34:16 GMT+0100 (IST))
2017-09-30 05:34:17:699 - info: [debug] [XCUITest] Available devices: c75…38915

Has anyone seen this recently, all the searches I’ve seen are on the socket hangup are on Appium 1.6.x and ios 10 or even 9.

Thanks
Ken

1 Like