macaca-ios升级到最新版本后socket hang up问题仍然存在
-
Macaca Version: 2.0.1
-
Macaca Doctor Logs: macaca-doctor version: 2.0.0
Node.js checklist:
node env: /usr/local/bin/node node version: v7.4.0
iOS checklist:
Xcode Command Line Tools require version: 2347 and above xcodebuild version: 8.3.2 iproxy[usbmuxd] is installed at:
/usr/local/bin/iproxyios_webkit_debug_proxy is installed at:/usr/local/bin/ios_webkit_debug_proxycarthage require version 0.22.0 and aboveAndroid checklist:
JAVA version is
1.8.0_111JAVA_HOME is set to/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/HomeANDROID_HOME is not set Command Line Tools: gradle is uninstalledInstalled driver list:
ios: 2.0.8
-
Operate System: iOS
-
Programming Language: Java
端口修改前:
index.js:17:12 [master] pid:34698 webdriver server start with config: { port: 3456, verbose: true, always: true, ip: '10.2.98.140', host: 'ranlideMacBook-Pro.local', loaded_time: '2017-05-21 18:37:38' } middlewares.js:17:10 [master] pid:34698 base middlewares attached router.js:127:10 [master] pid:34698 router set webdriver sdk launched
省略部分日志
macaca-ios.js:151:10 [master] pid:34698 Trying to start xctestwd server... BundleId XCTestWD.XCTestWD does not exist. xctestwd start with port: 8900 xctest-client.js:226:14 [master] pid:34698 xcode version: 8.3.2 XCTestWD version: 1.0.21 xctest-client.js:174:14 [master] pid:34698 2017-05-21 18:37:48.705 xcodebuild[34711:2168292] IDETestOperationsObserverDebug: Writing diagnostic log for test session to: /Users/ranli/Library/Developer/Xcode/DerivedData/XCTestWD-csksfttfbygcrbamoobfasiylmgb/Logs/Test/26A1A138-2396-4A74-8763-85F69922ADD0/Session-XCTestWDUITests-2017-05-21_183748-ojuNLI.log
xctest-client.js:175:14 [master] pid:34698 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj
省略部分日志
xctest-client.js:175:14 [master] pid:34698 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj xctest-client.js:174:14 [master] pid:34698 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/_n/sp1mz07j39df6tb2g37v0b4r0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/5a9aae719511bb65661b0db67cb0cc95/40911ef567d57fcff5813d774fdeb108eaefde1b/ManifestCache.plist
xctest-client.js:175:14 [master] pid:34698 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj xctest-client.js:174:14 [master] pid:34698 2017-05-21 18:38:35.665 xcodebuild[34711:2168287] Error Domain=IDETestOperationsObserverErrorDomain Code=13 "Failed to background test runner. If you believe this error represents a bug, please attach the log file at /Users/ranli/Library/Developer/Xcode/DerivedData/XCTestWD-csksfttfbygcrbamoobfasiylmgb/Logs/Test/26A1A138-2396-4A74-8763-85F69922ADD0/Session-XCTestWDUITests-2017-05-21_183748-ojuNLI.log" UserInfo={NSLocalizedDescription=Failed to background test runner. If you believe this error represents a bug, please attach the log file at /Users/ranli/Library/Developer/Xcode/DerivedData/XCTestWD-csksfttfbygcrbamoobfasiylmgb/Logs/Test/26A1A138-2396-4A74-8763-85F69922ADD0/Session-XCTestWDUITests-2017-05-21_183748-ojuNLI.log}
xctest-client.js:175:14 [master] pid:34698 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj xctest-client.js:174:14 [master] pid:34698 Testing failed: Test target XCTestWDUITests encountered an error (Failed to background test runner. If you believe this error represents a bug, please attach the log file at /Users/ranli/Library/Developer/Xcode/DerivedData/XCTestWD-csksfttfbygcrbamoobfasiylmgb/Logs/Test/26A1A138-2396-4A74-8763-85F69922ADD0/Session-XCTestWDUITests-2017-05-21_183748-ojuNLI.log)
xctest-client.js:175:14 [master] pid:34698 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj xctest-client.js:174:14 [master] pid:34698 ** TEST FAILED **
xctest-client.js:175:14 [master] pid:34698 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj xctest-client.js:257:14 [master] pid:34698 killing deviceLogProc pid: 34708 xctest-client.js:262:14 [master] pid:34698 killing runnerProc pid: 34711 xctest-client.js:268:14 [master] pid:34698 killing iproxyProc pid: 34710 xctest-client.js:185:14 [master] pid:34698 xctest client exit with code: 65, signal: null xctest-client.js:213:14 [master] pid:34698 iproxy exit with code: null, signal: SIGKILL xctest-client.js:147:16 [master] pid:34698 deviceconsole exit with code: null, signal: SIGKILL xctest-client.js:249:14 [master] pid:34698 Fail to start xctest: undefined responseHandler.js:54:12 [master] pid:34698 Send Error Respone to Client: undefined
InternalServerError: Internal Server Error
at Object.throw (/usr/local/lib/node_modules/macaca-cli/node_modules/koa/lib/context.js:91:23)
at Object.module.exports (/usr/local/lib/node_modules/macaca-cli/node_modules/webdriver-server/lib/server/responseHandler.js:57:17)
at module.exports.throw (
在case代码中初始化webdriverclient时更改端口后仍然出现高概率的连接失败,app-inspector也存在高概率失败: porps.put("proxyPort", 8001);
补充端口号更改以后概率性失败日志:
xctest-client.js:175:14 [master] pid:39085 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj proxy.js:55:14 [master] pid:39085 Proxy: /wd/hub/session:POST to http://127.0.0.1:8001/wd/hub/session:POST with body: {"desiredCapabilities":{"bundleId":"com.test.iphone","platformName":"ios"}} proxy.js:61:22 [master] pid:39085 xctest client proxy error with: Error: socket hang up proxy.js:61:22 [master] pid:39085 xctest client proxy error with: Error: socket hang up proxy.js:61:22 [master] pid:39085 xctest client proxy error with: Error: socket hang up proxy.js:61:22 [master] pid:39085 xctest client proxy error with: Error: socket hang up proxy.js:61:22 [master] pid:39085 xctest client proxy error with: Error: socket hang up xctest-client.js:174:14 [master] pid:39085 writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/_n/sp1mz07j39df6tb2g37v0b4r0000gn/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/5a9aae719511bb65661b0db67cb0cc95/40911ef567d57fcff5813d774fdeb108eaefde1b/ManifestCache.plist
xctest-client.js:175:14 [master] pid:39085 please check project: /usr/local/lib/node_modules/macaca-ios/node_modules/xctestwd/XCTestWD/XCTestWD.xcodeproj proxy.js:61:22 [master] pid:39085 xctest client proxy error with: Error: socket hang up proxy.js:61:22 [master] pid:39085 xctest client proxy error with: Error: socket hang up proxy.js:61:22 [master] pid:39085 xctest client proxy error with: Error: socket hang up proxy.js:61:22 [master] pid:39085 xctest client proxy error with: Error: socket hang up proxy.js:61:22 [master] pid:39085 xctest client proxy error with: Error: socket hang up proxy.js:61:22 [master] pid:39085 xctest client proxy error with: Error: socket hang up xctest-client.js:249:14 [master] pid:39085 Fail to start xctest: Error: socket hang up xctest-client.js:257:14 [master] pid:39085 killing deviceLogProc pid: 39094 xctest-client.js:262:14 [master] pid:39085 killing runnerProc pid: 39097 xctest-client.js:268:14 [master] pid:39085 killing iproxyProc pid: 39096 responseHandler.js:54:12 [master] pid:39085 Send Error Respone to Client: Error: socket hang up responseHandler.js:60:14 [master] pid:39085 Error: socket hang up at createHangUpError (_http_client.js:253:15) at Socket.socketOnEnd (_http_client.js:345:23) at emitNone (events.js:91:20) at Socket.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)
Error: socket hang up at createHangUpError (_http_client.js:253:15) at Socket.socketOnEnd (_http_client.js:345:23) at emitNone (events.js:91:20) at Socket.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)
xctest-client.js:147:16 [master] pid:39085 deviceconsole exit with code: null, signal: SIGKILL xctest-client.js:213:14 [master] pid:39085 iproxy exit with code: null, signal: SIGKILL xctest-client.js:185:14 [master] pid:39085 xctest client exit with code: null, signal: SIGKILL
@bluesky12345 麻烦查找一下模拟器的错误日志, 这样可以进一步定位问题, 谢谢啦
/usr/local/lib/node_modules/macaca-ios/node_modules/.1.0.22@xctestwd/lib/proxy.js 第13行: proxyPort: 8100, 改为: proxyPort: 8001,
/usr/local/lib/node_modules/macaca-ios/node_modules/.1.0.22@xctestwd/lib/xctest-client.js 第157行: XCTESTWD_PORT=8001 改为 XCTESTWD_PORT=${this.proxyPort}
@leemony 这个需要我本地修改吗?
嗯我本地改过之后,可以运行了;之前报错跟你一样的
@leemony macaca再次升级会不会覆盖掉本次修改?
macaca-doctor version: 2.0.0
Node.js checklist:
node env: /usr/local/bin/node node version: v7.6.0
iOS checklist:
Xcode is installed at: /Applications/Xcode.app/Contents/Developer
Xcode Command Line Tools is ready, version: 2347.
xcodebuild version: 8.3.2
iproxy[usbmuxd] is installed at: /usr/local/bin/iproxy
ios_webkit_debug_proxy is installed at: /usr/local/bin/ios_webkit_debug_proxy
carthage is installed, version: 0.23.0
Installed driver list: ios: 2.0.9
会的覆盖的,这应该是个bug
@leemony 好的,我本地先尝试按照你的修改试一下,升级之后再看情况处理吧。谢谢!
@leemony 我照着改了,仍然有同样的报错
@bluesky12345 @Only7 macaca-ios 和macaca-cli 有重新安装至最新嘛,上面有贴我的环境,都更新到最新了(xctestwd 已更新到1.0.22)
@leemony 抱歉前一段时间再忙其它事情,没有验证。我参照你的建议修改后出现了InternalServerError错误。我这边macaca的版本是2.0.1。我现在准备卸载重装macaca再验证,谢谢。
npm i [email protected] -g
@leemony 是的我的xctestwd是最新1.0.22 之前运行成功过一次,测试机连了次代理关闭后,又开始报同样的错了呢,有解决办法吗?
@Only7 1.0.26
@leemony 有1.0.26了?怎么更新呢?
@Only7 npm i [email protected] -g
@leemony 升级了 照着您的方法做了两处的修改 运行成功过几次后 又开始报之前同样的错误,您对这个情况了解吗
@Only7 最新版本已经修正了那两处,不用再改了;如果你发现还能改,那你的环境还没有升级
@leemony 现在发现有时手机重启 可以解决monkey运行问题,有时重启无效,您遇到过这个问题吗?