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

WDA session stops when running test sets with over then 30 tests #507

Closed
vjmaiky opened this issue Mar 7, 2017 · 23 comments
Closed

WDA session stops when running test sets with over then 30 tests #507

vjmaiky opened this issue Mar 7, 2017 · 23 comments

Comments

@vjmaiky
Copy link

vjmaiky commented Mar 7, 2017

Environment

  • Appium version: 1.6.4
  • Latest version of WDA
  • Desktop OS/version used to run Appium: Mac OS 10.11.6
  • Node.js version: v7.4.0
  • Mobile platform/version under test: iOS 10.2.1 (iPhone 6+)
  • Real device: iPhone 6+

Details

Basically i have test sets with over 30 test each. I let them to run on night but after 30-40 tests everything stops. I do not have the exact error (because accidentally i deleted) but the run remains in a state where local host in no longer recognized. I`ll update with tonight results.

Do i need to add something to my suite?

I`m using last WDA, Appium (i updated them yesterday). I basically uninstall the app before each test because i need to reset some permissions. If first 30-40 test run correctly i imagine that something is missing. Do i need to add something to clear ports or something like that?

this are my capabilities:

capabilities.setCapability("appium-version", APPIUM_VERSION);
	capabilities.setCapability("platformName", PLATFORM_NAME);
	capabilities.setCapability("platformVersion", IOS_VERSION);
	capabilities.setCapability("deviceName", DEVICE_NAME);
	capabilities.setCapability("app", APP_LOCATION);
	if (!IS_SIMULATOR) {
		capabilities.setCapability("udid", DEVICE_UDID);
	}
	capabilities.setCapability("newCommandTimeout", TIMEOUT_COMMAND);
	capabilities.setCapability("automationName", AUTOMATION_NAME);
	capabilities.setCapability("realDeviceLogger", "/usr/local/lib/node_modules/deviceconsole/deviceconsole");
	capabilities.setCapability(MobileCapabilityType.ROTATABLE, true);

This is also an error from another jenkins box machine:

Xcode]
[Xcode] ** TEST EXECUTE FAILED **
[Xcode]
[Xcode]
[Xcode] 2017-03-07 19:43:11.996108 XCTRunner[2185:963232] Running tests...
[Xcode]
[XCUITest] xcodebuild exited with code '65' and signal 'null'
[debug] [BaseDriver] Event 'wdaStartFailed' logged at 1488908630431 (19:43:50 GMT+0200 (EET))
[debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[debug] [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down iproxy process (pid 97300)
[debug] [XCUITest] iproxy exited with code 'null'
[debug] [XCUITest] Removing WDA application from device
[XCUITest] Error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
at XCUITestDriver.quitAndUninstall$ (../../lib/driver.js:349:15)
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 next] (/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 process._tickCallback (internal/process/next_tick.js:103:7)
Error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
at XCUITestDriver.quitAndUninstall$ (../../lib/driver.js:349:15)
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 next] (/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 process._tickCallback (internal/process/next_tick.js:103:7)
[debug] [iOSLog] Stopping iOS log capture
[MJSONWP] Encountered internal error running command: Error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
at XCUITestDriver.quitAndUninstall$ (../../lib/driver.js:349:15)
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 next] (/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 process._tickCallback (internal/process/next_tick.js:103:7)
[HTTP] <-- POST /wd/hub/session 500 127349 ms - 230
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/Shared/Appium/TelekomMail-VTU-Universal.ipa","rotatable":true,"deviceName":"iPhone 6 Plus (10.0.1) [be4589523400203cde630500317a8eb6aca7f397]","fullReset":true,"appium-version":"1.0","newCommandTimeout":600,"realDeviceLogger":"/usr/local/lib/node_modules/deviceconsole/deviceconsole","platformVersion":"10.2.1","automationName":"XCUITest","waitForAppScript":"$.delay(1000); $.acceptAlert();","platformName":"iOS","udid":"be4589523400203cde630500317a8eb6aca7f397"}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/Shared/Appium/TelekomMail-VTU-Universal.ipa","rotatable":true,"deviceName":"iPhone 6 Plus (10.0.1) [be4589523400203cde630500317a8eb6aca7f397]","fullReset":true,"appium-version":"1.0","newCommandTimeout":600,"realDeviceLogger":"/usr/local/lib/node_modules/deviceconsole/deviceconsole","platformVersion":"10.2.1","automationName":"XCUITest","waitForAppScript":"$.delay(1000); $.acceptAlert();","platformName":"iOS","udid":"be4589523400203cde630500317a8eb6aca7f397"},null,null,null,null]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1488908641312 (19:44:01 GMT+0200 (EET))
[Appium] Creating new XCUITestDriver (v2.15.0) session
[Appium] Capabilities:
[Appium] app: '/Users/Shared/Appium/TelekomMail-VTU-Universal.ipa'
[Appium] rotatable: true
[Appium] deviceName: 'iPhone 6 Plus (10.0.1) [be4589523400203cde630500317a8eb6aca7f397]'
[Appium] fullReset: true
[Appium] appium-version: '1.0'
[Appium] newCommandTimeout: 600
[Appium] realDeviceLogger: '/usr/local/lib/node_modules/deviceconsole/deviceconsole'
[Appium] platformVersion: '10.2.1'
[Appium] automationName: 'XCUITest'
[Appium] waitForAppScript: '$.delay(1000); $.acceptAlert();'
[Appium] platformName: 'iOS'
[Appium] udid: 'be4589523400203cde630500317a8eb6aca7f397'
[debug] [XCUITest] XCUITestDriver version: 2.15.0
[BaseDriver] The following capabilities were provided, but are not recognized by appium: rotatable, appium-version, realDeviceLogger.
[BaseDriver] Session created with session id: 1ed62074-b10b-4742-86ea-c0cfe1af5f9c
[debug] [XCUITest] Xcode version set to '8.2.1' (tools v7.3.1.0.1.1461711523)
[debug] [XCUITest] iOS SDK Version set to '10.2'
[debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1488908641347 (19:44:01 GMT+0200 (EET))
[debug] [XCUITest] Available devices: be4589523400203cde630500317a8eb6aca7f397
[debug] [XCUITest] Creating iDevice object with udid 'be4589523400203cde630500317a8eb6aca7f397'
[XCUITest] Determining device to run tests on: udid: 'be4589523400203cde630500317a8eb6aca7f397', real device: true
[BaseDriver] Using local app '/Users/Shared/Appium/TelekomMail-VTU-Universal.ipa'
[debug] [BaseDriver] Copying local zip to tmp dir
[debug] [BaseDriver] Unzipping /var/folders/fr/30sh3xg91zxbk588tb95yjxc00007x/T/201727-93312-1rhjfe1.0x1vih33di/appium-app.zip
[debug] [BaseDriver] Testing zip archive: /var/folders/fr/30sh3xg91zxbk588tb95yjxc00007x/T/201727-93312-1rhjfe1.0x1vih33di/appium-app.zip
[BaseDriver] Unzipped local app to '/var/folders/fr/30sh3xg91zxbk588tb95yjxc00007x/T/201727-93312-1rhjfe1.0x1vih33di/Payload/TelekomMail-VTU.app'
[debug] [BaseDriver] Event 'appConfigured' logged at 1488908642419 (19:44:02 GMT+0200 (EET))
[debug] [XCUITest] Checking whether app '/var/folders/fr/30sh3xg91zxbk588tb95yjxc00007x/T/201727-93312-1rhjfe1.0x1vih33di/Payload/TelekomMail-VTU.app' is actually present on file system
[debug] [XCUITest] App is present
[debug] [iOS] Getting bundle ID from app '/var/folders/fr/30sh3xg91zxbk588tb95yjxc00007x/T/201727-93312-1rhjfe1.0x1vih33di/Payload/TelekomMail-VTU.app': 'endava.de.telekom.telekommail.vtu'
[debug] [BaseDriver] Event 'resetStarted' logged at 1488908642424 (19:44:02 GMT+0200 (EET))
[debug] [XCUITest] Reset: running ios real device reset flow
[debug] [XCUITest] Reset: fullReset requested. Will try to uninstall the app 'endava.de.telekom.telekommail.vtu'.
[debug] [XCUITest] Reset: removed 'endava.de.telekom.telekommail.vtu'
[debug] [BaseDriver] Event 'resetComplete' logged at 1488908642993 (19:44:02 GMT+0200 (EET))
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog'
[debug] [BaseDriver] Event 'logCaptureStarted' logged at 1488908643063 (19:44:03 GMT+0200 (EET))
[XCUITest] Setting up real device
[debug] [XCUITest] Installing '/var/folders/fr/30sh3xg91zxbk588tb95yjxc00007x/T/201727-93312-1rhjfe1.0x1vih33di/Payload/TelekomMail-VTU.app' on device with UUID 'be4589523400203cde630500317a8eb6aca7f397'...
[debug] [XCUITest] The app has been installed successfully.
[debug] [BaseDriver] Event 'appInstalled' logged at 1488908648467 (19:44:08 GMT+0200 (EET))
[debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1488908648468 (19:44:08 GMT+0200 (EET))
[XCUITest] Using WDA path: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: '/usr/local/bin/carthage'
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=be4589523400203cde630500317a8eb6aca7f397 -configuration Debug' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[debug] [XCUITest] Output from xcodebuild will not be logged
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[debug] [XCUITest] Log file for xcodebuild test: /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/5EA3F599-6BB5-4072-A2C2-B7F7C1CE3783/Session-WebDriverAgentRunner-2017-03-07_194415-KENpdK.log
[Xcode] 2017-03-07 19:44:58.206 xcodebuild[97356:1701802] Error Domain=IDETestOperationsObserverErrorDomain Code=5 "Early unexpected exit, operation never finished bootstrapping - no restart will be attempted" UserInfo={NSLocalizedDescription=Early unexpected exit, operation never finished bootstrapping - no restart will be attempted}
[Xcode]
[Xcode] ** TEST EXECUTE FAILED **
[Xcode]
[Xcode]
[Xcode] 2017-03-07 19:44:19.880005 XCTRunner[2192:963976] Running tests...
[Xcode]
[XCUITest] xcodebuild exited with code '65' and signal 'null'
[debug] [BaseDriver] Event 'wdaStartFailed' logged at 1488908698380 (19:44:58 GMT+0200 (EET))
[debug] [XCUITest] Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
[debug] [XCUITest] Quitting and uninstalling WebDriverAgent, then retrying
[XCUITest] Shutting down sub-processes
[XCUITest] Shutting down iproxy process (pid 97355)
[debug] [XCUITest] iproxy exited with code 'null'
[debug] [XCUITest] Removing WDA application from device
[debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1488908708779 (19:45:08 GMT+0200 (EET))
[XCUITest] Using WDA path: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: '/usr/local/bin/carthage'
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=be4589523400203cde630500317a8eb6aca7f397 -configuration Debug' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[debug] [XCUITest] Output from xcodebuild will not be logged
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[debug] [XCUITest] Log file for xcodebuild test: /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/F7DD328E-9E58-4425-B165-BC03C3B4A3A8/Session-WebDriverAgentRunner-2017-03-07_194515-B65YVI.log

Also i have problems with low end devices like iphone 5C. I need to restart device every 4-5 runs (i read something that it`s related to x86 and x64 devices. Here is the log:

Last login: Mon Mar 6 19:27:52 on console
admins-Mac-mini:~ jenkins$ appium
[Appium] Welcome to Appium v1.6.4-beta
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/Shared/Appium/TelekomMail-VTU-Universal.ipa","rotatable":true,"deviceName":"iPhone5C (10.2.1) [375634bee3a266c6b803bbb52137a2b73a49860b]","fullReset":true,"appium-version":"1.6.4","newCommandTimeout":600,"realDeviceLogger":"/usr/local/lib/node_modules/deviceconsole/deviceconsole","platformVersion":"10.2.1","automationName":"XCUITest","waitForAppScript":"$.delay(1000); $.acceptAlert();","platformName":"iOS","udid":"375634bee3a266c6b803bbb52137a2b73a49860b"}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/Shared/Appium/TelekomMail-VTU-Universal.ipa","rotatable":true,"deviceName":"iPhone5C (10.2.1) [375634bee3a266c6b803bbb52137a2b73a49860b]","fullReset":true,"appium-version":"1.6.4","newCommandTimeout":600,"realDeviceLogger":"/usr/local/lib/node_modules/deviceconsole/deviceconsole","platformVersion":"10.2.1","automationName":"XCUITest","waitForAppScript":"$.delay(1000); $.acceptAlert();","platformName":"iOS","udid":"375634bee3a266c6b803bbb52137a2b73a49860b"},null,null,null,null]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1488828291277 (21:24:51 GMT+0200 (EET))
[Appium] Creating new XCUITestDriver (v2.15.0) session
[Appium] Capabilities:
[Appium] app: '/Users/Shared/Appium/TelekomMail-VTU-Universal.ipa'
[Appium] rotatable: true
[Appium] deviceName: 'iPhone5C (10.2.1) [375634bee3a266c6b803bbb52137a2b73a49860b]'
[Appium] fullReset: true
[Appium] appium-version: '1.6.4'
[Appium] newCommandTimeout: 600
[Appium] realDeviceLogger: '/usr/local/lib/node_modules/deviceconsole/deviceconsole'
[Appium] platformVersion: '10.2.1'
[Appium] automationName: 'XCUITest'
[Appium] waitForAppScript: '$.delay(1000); $.acceptAlert();'
[Appium] platformName: 'iOS'
[Appium] udid: '375634bee3a266c6b803bbb52137a2b73a49860b'
[debug] [XCUITest] XCUITestDriver version: 2.15.0
[BaseDriver] The following capabilities were provided, but are not recognized by appium: rotatable, appium-version, realDeviceLogger.
[BaseDriver] Session created with session id: 085c656e-82be-4f46-9293-730af80ee758
[debug] [XCUITest] Xcode version set to '8.2.1' (tools v7.3.1.0.1.1461711523)
[debug] [XCUITest] iOS SDK Version set to '10.2'
[debug] [BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1488828291407 (21:24:51 GMT+0200 (EET))
[debug] [XCUITest] Available devices: 375634bee3a266c6b803bbb52137a2b73a49860b
[debug] [XCUITest] Creating iDevice object with udid '375634bee3a266c6b803bbb52137a2b73a49860b'
[XCUITest] Determining device to run tests on: udid: '375634bee3a266c6b803bbb52137a2b73a49860b', real device: true
[BaseDriver] Using local app '/Users/Shared/Appium/TelekomMail-VTU-Universal.ipa'
[debug] [BaseDriver] Copying local zip to tmp dir
[debug] [BaseDriver] Unzipping /var/folders/fr/30sh3xg91zxbk588tb95yjxc00007x/T/201726-83516-154cbnq.1revw5qaor/appium-app.zip
[debug] [BaseDriver] Testing zip archive: /var/folders/fr/30sh3xg91zxbk588tb95yjxc00007x/T/201726-83516-154cbnq.1revw5qaor/appium-app.zip
[BaseDriver] Unzipped local app to '/var/folders/fr/30sh3xg91zxbk588tb95yjxc00007x/T/201726-83516-154cbnq.1revw5qaor/Payload/TelekomMail-VTU.app'
[debug] [BaseDriver] Event 'appConfigured' logged at 1488828292482 (21:24:52 GMT+0200 (EET))
[debug] [XCUITest] Checking whether app '/var/folders/fr/30sh3xg91zxbk588tb95yjxc00007x/T/201726-83516-154cbnq.1revw5qaor/Payload/TelekomMail-VTU.app' is actually present on file system
[debug] [XCUITest] App is present
[debug] [iOS] Getting bundle ID from app '/var/folders/fr/30sh3xg91zxbk588tb95yjxc00007x/T/201726-83516-154cbnq.1revw5qaor/Payload/TelekomMail-VTU.app': 'endava.de.telekom.telekommail.vtu'
[debug] [BaseDriver] Event 'resetStarted' logged at 1488828292491 (21:24:52 GMT+0200 (EET))
[debug] [XCUITest] Reset: running ios real device reset flow
[debug] [XCUITest] Reset: fullReset requested. Will try to uninstall the app 'endava.de.telekom.telekommail.vtu'.
[debug] [XCUITest] Reset: removed 'endava.de.telekom.telekommail.vtu'
[debug] [BaseDriver] Event 'resetComplete' logged at 1488828293630 (21:24:53 GMT+0200 (EET))
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[debug] [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog'
[debug] [BaseDriver] Event 'logCaptureStarted' logged at 1488828294133 (21:24:54 GMT+0200 (EET))
[XCUITest] Setting up real device
[debug] [XCUITest] Installing '/var/folders/fr/30sh3xg91zxbk588tb95yjxc00007x/T/201726-83516-154cbnq.1revw5qaor/Payload/TelekomMail-VTU.app' on device with UUID '375634bee3a266c6b803bbb52137a2b73a49860b'...
[debug] [XCUITest] The app has been installed successfully.
[debug] [BaseDriver] Event 'appInstalled' logged at 1488828299621 (21:24:59 GMT+0200 (EET))
[debug] [BaseDriver] Event 'wdaStartAttempted' logged at 1488828299624 (21:24:59 GMT+0200 (EET))
[XCUITest] Using WDA path: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: '/usr/local/bin/carthage'
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Beginning test with command 'xcodebuild build-for-testing test-without-building -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=375634bee3a266c6b803bbb52137a2b73a49860b -configuration Debug' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[debug] [XCUITest] Output from xcodebuild will not be logged
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB
[debug] [XCUITest] Waiting up to 60000ms for WebDriverAgent to start
[debug] [XCUITest] Log file for xcodebuild test: /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/889FAE4E-58AD-4C8D-BBFA-B49233204C1C/Session-WebDriverAgentRunner-2017-03-06_212506-Mg6AAE.log
[Xcode] 2017-03-06 21:25:10.585 xcodebuild[83554:1501029] DTDeviceKit: Could not start house arrest service for app identifier com.apple.test.WebDriverAgentRunner-Runner [Error Domain=com.apple.dtdevicekit Code=-402653093 "Too many instances of this service are already running." UserInfo={NSLocalizedFailureReason=Too many instances of this service are already running., com.apple.dtdevicekit.stacktrace=(
[Xcode] 0 DTDeviceKitBase 0x000000011205f37b DTDKCreateNSError + 113
[Xcode] 1 DTDeviceKitBase 0x000000011205fab9 DTDK_AMDErrorToNSError + 791
[Xcode] 2 DTDeviceKitBase 0x00000001120712a5 __70-[DTDKRemoteDeviceConnection startHouseArrestServiceForAppIdentifier:]_block_invoke + 100
[Xcode] 3 DTDeviceKitBase 0x0000000112070181 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_4 + 22
[Xcode] 4 DTDeviceKitBase 0x00000001120622c7 __DTDKExecuteInSession_block_invoke + 38
[Xcode] 5 DTDeviceKitBase 0x00000001120618f0 __DTDKExecuteWithConnection_block_invoke_2 + 477
[Xcode] 6 DTDeviceKitBase 0x00000001120616ec __DTDKExecuteWithConnection_block_invoke + 107
[Xcode] 7 libdispatch.dylib 0x00007fff9767740b _dispatch_client_callout + 8
[Xcode] 8 libdispatch.dylib 0x00007fff97685a9a _dispatch_barrier_sync_f_slow + 856
[Xcode] 9 DVTFoundation 0x00000001091ba95b DVTDispatchBarrierSync + 206
[Xcode] 10 DVTFoundation 0x0000000109197307 -[DVTDispatchLock performLockedBlock:] + 116
[Xcode] 11 DTDeviceKitBase 0x00000001120615f6 DTDKExecuteWithConnection + 223
[Xcode] 12 DTDeviceKitBase 0x0000000112062251 DTDKExecuteInSession + 121
[Xcode] 13 DTDeviceKitBase 0x00000001120700b8 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 117
[Xcode] 14 DVTFoundation 0x00000001091b9cb7 __DVTDispatchAsync_block_invoke + 827
[Xcode] 15 libdispatch.dylib 0x00007fff9768293d _dispatch_call_block_and_release + 12
[Xcode] 16 libdispatch.dylib 0x00007fff9767740b _dispatch_client_callout + 8
[Xcode] 17 libdispatch.dylib 0x00007fff97689bd7 _dispatch_async_redirect_invoke + 1733
[Xcode] 18 libdispatch.dylib 0x00007fff9767740b _dispatch_client_callout + 8
[Xcode] 19 libdispatch.dylib 0x00007fff9767b29b _dispatch_root_queue_drain + 1890
[Xcode] 20 libdispatch.dylib 0x00007fff9767ab00 _dispatch_worker_thread3 + 91
[Xcode] 21 libsystem_pthread.dylib 0x00007fff9760a4de _pthread_wqthread + 1129
[Xcode] 22 libsystem_pthread.dylib 0x00007fff97608341 start_wqthread + 13
[Xcode] ), NSLocalizedRecoverySuggestion=Too many instances of this service are already running., NSLocalizedDescription=Too many instances of this service are already running.}]
[Xcode]
[debug] [XCUITest] WebDriverAgent running on ip '172.16.102.72'
[debug] [XCUITest] WebDriverAgent successfully started after 8609ms
[debug] [BaseDriver] Event 'wdaSessionAttempted' logged at 1488828313349 (21:25:13 GMT+0200 (EET))
[debug] [XCUITest] Sending createSession command to WDA
[debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"endava.de.telekom.telekommail.vtu","arguments":[],"environment":{},"shouldWaitForQuiescence":true}}

Any advice how to deal with nightly runs? i`ll add the logs from tonight in few hours.

@carbonfish
Copy link

@vjmaiky
Copy link
Author

vjmaiky commented Mar 9, 2017

this is the state taken from Appium console:

[debug] [XCUITest] Executing command 'findElement'
[HTTP] <-- POST /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/element - - ms - -
[HTTP] --> POST /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/element {"using":"xpath","value":"//XCUIElementTypeStaticText[@name='Betreff']/preceding-sibling::XCUIElementTypeTextField[1]"}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: ["xpath","//XCUIElementTypeStaticText[@name='Betreff']/preceding-sibling::XCUIElementTypeTextField[1]","6d8146ec-4240-4aaa-941c-68b98e4ed7ca"]
[debug] [XCUITest] Executing command 'findElement'
[HTTP] <-- POST /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/element - - ms - -
[HTTP] --> POST /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/element {"using":"xpath","value":"//XCUIElementTypeStaticText[@name='Betreff']/preceding-sibling::XCUIElementTypeTextField[1]"}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: ["xpath","//XCUIElementTypeStaticText[@name='Betreff']/preceding-sibling::XCUIElementTypeTextField[1]","6d8146ec-4240-4aaa-941c-68b98e4ed7ca"]
[debug] [XCUITest] Executing command 'findElement'
[HTTP] <-- POST /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/element - - ms - -
[HTTP] --> GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[HTTP] <-- GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot - - ms - -
[HTTP] --> GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[HTTP] <-- GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot - - ms - -
[HTTP] --> GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[HTTP] <-- GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot - - ms - -
[HTTP] --> GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[HTTP] <-- GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot - - ms - -
[HTTP] --> GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[HTTP] <-- GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot - - ms - -
[HTTP] --> GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[HTTP] <-- GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot - - ms - -
[HTTP] --> GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot {}
[MJSONWP] Driver proxy active, passing request on via HTTP proxy
[debug] [XCUITest] Executing command 'proxyReqRes'
[HTTP] <-- GET /wd/hub/session/6d8146ec-4240-4aaa-941c-68b98e4ed7ca/screenshot - - ms - -

@vjmaiky
Copy link
Author

vjmaiky commented Mar 9, 2017

my Logs:

Caused by: org.openqa.selenium.WebDriverException: org.apache.http.NoHttpResponseException: 0.0.0.0:4723 failed to respond
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'Leventes-Mac-mini.local', ip: '172.16.102.60', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_45'
Driver info: driver.version: IOSDriver
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:76)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644)
... 57 more
Caused by: org.apache.http.NoHttpResponseException: 0.0.0.0:4723 failed to respond
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:261)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:165)
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:167)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:272)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:124)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:271)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:162)
at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:90)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:64)
... 58 more
Mar 09, 2017 5:04:23 AM org.openqa.selenium.remote.Augmenter extractRemoteWebDriver
WARNING: Augmenter should be applied to the instances of @augmentable classes or previously augmented instances only
2017-03-09 05:14:23 INFO RetryExec:96 - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:4723: The target server failed to respond
2017-03-09 05:14:23 INFO RetryExec:112 - Retrying request to {}->http://0.0.0.0:4723
2017-03-09 05:24:23 INFO RetryExec:96 - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:4723: The target server failed to respond
2017-03-09 05:24:24 INFO RetryExec:112 - Retrying request to {}->http://0.0.0.0:4723
2017-03-09 05:34:24 INFO RetryExec:96 - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:4723: The target server failed to respond
2017-03-09 05:34:24 INFO RetryExec:112 - Retrying request to {}->http://0.0.0.0:4723
2017-03-09 05:54:26 INFO RetryExec:96 - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:4723: The target server failed to respond
2017-03-09 05:54:26 INFO RetryExec:112 - Retrying request to {}->http://0.0.0.0:4723
2017-03-09 06:04:26 INFO RetryExec:96 - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:4723: The target server failed to respond
2017-03-09 06:04:26 INFO RetryExec:112 - Retrying request to {}->http://0.0.0.0:4723
2017-03-09 06:14:26 INFO RetryExec:96 - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:4723: The target server failed to respond
2017-03-09 06:14:26 INFO RetryExec:112 - Retrying request to {}->http://0.0.0.0:4723
2017-03-09 06:34:26 INFO RetryExec:96 - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:4723: The target server failed to respond
2017-03-09 06:34:26 INFO RetryExec:112 - Retrying request to {}->http://0.0.0.0:4723
2017-03-09 06:44:26 INFO RetryExec:96 - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:4723: The target server failed to respond

@rajanbharti
Copy link

rajanbharti commented Mar 14, 2017

I am also having same issue, can anyone help?
WebDriver becomes unresponsive after certain number of requests

@kenmcc
Copy link

kenmcc commented Mar 14, 2017

I noticed the same thing recently, but I'm not sure there's a definite 'number'.
my test sequence is like this (real ipadpro, ios10.2.1):

for each test run:
    launch youtube app
    for each loop in test run:
         for each of 3 videos i want to search:
              tap coordinates for search icon  (wait 3 seconds to settle)
              enter the title of the video to find    (wait 3 seconds to settle)
              tap in the coordinates of the top most result ( wait 30 seconds to watch video)
              swipe the video away to the bottom right to expose the back icon (wait 3 seconds)
              tap the coordinates of the back arrow (wait 3 seconds)
    exit the application

I've seen various results for different values of "test run" and "loop", with 1,1 usually being ok, but even iterations like 1, 10 being problematic, never mind 10, 100.

Any help would be much appreciated.

@marekcirkos
Copy link
Contributor

As @carbonfish mentioned this is known Xcode issue. Unfortunately there is nothing we can do :/

@kenmcc
Copy link

kenmcc commented Mar 15, 2017

What @carbonfish mentioned as the known xcode issue is for the iphone5c device afaik, and I've seen that on older ipads also. But that issue is not seen on the newer ipad/iphone 6, where we can start many many sessions in a row without having to reboot the device.

It probably doesn't help that the original post references 2 different issues - the one I referred to yesterday that I'm also seeing is the first one, and that referenced in @vjmaiky 's post 4 previous to this; the WDA seems to get stuck for essentially ever until it times out after 10 minutes without doing anything onscreen of the device.

The same logs are visible in his e.g.:

2017-03-09 05:14:23 INFO RetryExec:96 - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://0.0.0.0:4723: The target server failed to respond
2017-03-09 05:14:23 INFO RetryExec:112 - Retrying request to {}->http://0.0.0.0:4723
2017-03-09 05:24:23 INFO RetryExec:96 - I/O exception

Where there are 10 minutes between 'Retrying request' and 'I/O exception' logs.

I'll add my logs when i capture a new run

@marekcirkos
Copy link
Contributor

I have seen this issue on other devices as well so I don't think this is device specific

@kenmcc
Copy link

kenmcc commented Mar 15, 2017

What do you mean by 'this' issue? this initial query refers to at least 2 'issues';
1 - seems to be WDA hanging after a bunch of tests

Basically i have test sets with over 30 test each. I let them to run on night but after 30-40 tests everything stops. I do not have the exact error (because accidentally i deleted) but the run remains in a state where local host in no longer recognized. I`ll update with tonight results.
Setup is an iphone 6+

2 - the known issue with 'too many instances of this service are already running

Also i have problems with low end devices like iphone 5C. I need to restart device every 4-5 runs (i read something that it`s related to x86 and x64 devices. Here is the log:

And indeed that is not device specific, I've seen it on an ipad and ipad mini, circa 2012 generations, but not on newer devices (those listed next line)

I'm referring to the issue 1 which i've seen on a new Ipad Pro 9.7" (2016) and an iphone 6 (2014)

I suggest this post be split into 2 different issues as they are confusing

@rajanbharti
Copy link

It's not device specific, i tested on 5 different devices. Same problem on every device.

@marekcirkos
Copy link
Contributor

They are both Xcode known issues, there is nothing WDA can do as it hangs before even WDA is invoked. Best you can do is to file a bug with Apple.
I know it sucks and I would love it fixed as well, but we need to wait for Apple to fix it

@shapovalovei
Copy link

Hey Guys, maybe we can coordinate with you and create issues for Apple ?

@marekcirkos
Copy link
Contributor

Absolutely, it will send stronger signal to Apple.

@abh7nav
Copy link

abh7nav commented May 12, 2017

I have one update. I have two ios 10.3.1 device. One works on my machine but other does not and same for my colleague the device working on my machine is not working for him and the one working for him is not working for me. Strange!!

@mykola-mokhnach
Copy link
Contributor

@kenmcc @vjmaiky I have recently created a small utility class for Appium, which helps to keep WDA running for as long as possible without being reinstalled: https://github.com/mykola-mokhnach/appium/blob/672ab7fd341862b23facc44063b1d26152efbf65/docs/en/advanced-concepts/wda-custom-server.md

Can you please try this approach and say if the situation becomes better or it's still the same?

@kenmcc
Copy link

kenmcc commented Jun 2, 2017 via email

@mayureshshirodkar
Copy link

@mykola-mokhnach won't this capability help.?
iOSCapabilities.setCapability("usePrebuiltWDA",true);

@vjmaiky
Copy link
Author

vjmaiky commented Jun 6, 2017

@mykola-mokhnach ill give it a try when im back in the office

@mykola-mokhnach
Copy link
Contributor

@mayureshshirodkar No, setting this capability to true only skips building phase for WDA, but it is anyway reinstalled on the device and restarted.

@senevit4
Copy link

@marekcirkos , hi, any success in signaling about this issue to apple?

@chanugithub
Copy link

@mykola-mokhnach Hello mykola, i am getting the error 65 repeatedly and saying
"Unable to install "WebDriverAgentRunner-Runner
[XCUITest] Cannot find xcodebuild's process id, so unable to retrieve DerivedData folder path
[XCUITest] No WebDriverAgent derived data available, so unable to clear system files

I want to customly run the WDA with your script. https://github.com/mykola-mokhnach/appium/blob/672ab7fd341862b23facc44063b1d26152efbf65/docs/en/advanced-concepts/wda-custom-server.md
Hence i modified your class according to my preferences but getting error with only one line where 'UnixProcessHelpers' is used to kill, i could find any utility to import or correct this UnixProcessHelpers', can you explain how to resolve this

@tomljones
Copy link

I would love to use this solution recommended by @mykola-mokhnach but I can't get it to compile. I need to find a source for the classes UnixProcessHelpers and Timedelta. Does anyone know where to find those libraries?

@vytran9599
Copy link

@mykola-mokhnach do you have the workaround code in Python?

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