【问题标题】:HTTPClient::ConnectTimeoutError: execution expiredHTTPClient::ConnectTimeoutError: 执行已过期
【发布时间】:2016-03-29 21:04:41
【问题描述】:

环境:

xcode 路径:/Applications/Xcode.app/Contents/Developer
xcode 版本:Xcode 7.3
葫芦-ios 版本:0.18.2
run_loop 版本:2.0.9
模拟器:iPhone 6s Plus (9.3)

从 Xcode 手动启动我的应用程序并做了:

$ curl http://localhost:37265/version
{
    "device_family": "iPhone",
    "outcome": "SUCCESS",
    "server_port": 37265,
    "simulator_devic e": "iPhone",
    "simulator": "CoreSimulator 209.19 - Device: iPhone 6s Plus -    Runtime: iOS 9.3 (13E230) - DeviceType: iPhone 6s Plus",
    "app_name": "SOTesters",
    "app_version": "11.2",
    "screen_dimensions": {
        "sample": 1,
        "height": 2208,
        "width": 1242,
        "scale": 3
    },
    "git": {
        "revision": "68026d3",
        "remote_origin": "git@github.com:calabash\/calabash-ios-server.git",
        "branch": "master"
    },
    "device_name": "iPhone Simulator",
    "4inch": false,
    "app_id": "com.goinstant.internal.SOTesters",
    "form_factor": "iphone 6+",
    "system": "x86_64",
    "version": "0.18.2",
    "iOS_version": "9.3",
    "short_version_string": "11.2",
    "ios_version": "9.3",
    "iphone_app_emulated_on_ipad": false,
    "model_identifier": "iPhone8,2",
    "app_base_sdk": "iphonesimulator9.3"
}

复制步骤
1. 构建应用到 iPhone 6s Plus (9.3) 模拟器
2. 启动 DEBUG=1 DEBUG_HTTP=1 DEVICE_TARGET='iPhone 6s Plus (9.3)'calabash-ios 控制台

irb(main):003:0> start_test_server_in_background

EXEC: xcrun strings /Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app/SOTesters
INFO: Detected app at path:
 INFO: /Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app
 INFO: Modification time of app: Tue 29 Mar 2016 17:20:52 ADT
 INFO: If this is incorrect, set the APP variable and/or rebuild your app
 INFO: It is your responsibility to ensure you are testing the right app.

INFO: Using uia strategy: 'host'
DEBUG: Searching for run-loop results with glob: /Users/k/.run-loop/results/*
DEBUG: Found 6 previous run-loop results
DEBUG: Will delete 1 previous run-loop results
DEBUG: Deleted 1 previous results in 0.007448 seconds
DEBUG: Searching for instruments caches with glob:     /Library/Caches/com.apple.dt.instruments/xrtmp__*
DEBUG: Found 6 instruments caches
DEBUG: Will delete 1 instruments caches
DEBUG: Deleted 1 instruments caches in 0.002827 seconds
DEBUG: Simulator instruction set 'x86_64' is compatible with '["x86_64"]'
DEBUG: Deleting /Users/k/Library/Developer/CoreSimulator/Devices/DDB1E8ED-    025F-40E5-AF6C-1A99C30729B9/data/tmp/instruments_cvg4z3/stdio.pipe
DEBUG: Installed app is the same as #<APP: /Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app>
DEBUG: Launching #<Simulator: iPhone 6s Plus (9.3) DDB1E8ED-025F-40E5-AF6C-1A99C30729B9 x86_64> with:
EXEC: xcrun open -g -a /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app --args -CurrentDeviceUDID DDB1E8ED-025F-40E5-AF6C-1A99C30729B9
DEBUG: Waiting for simulator to stabilize with timeout: 30
DEBUG: Simulator stable after 4.394763 seconds
DEBUG: Waited a total of 6.394763 seconds for simulator to stabilize
DEBUG: Took 6.519767 seconds to launch the simulator
2016-03-29 22:23:23 -0300 [RunLoop:debug]:
{
                    :app => "/Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app",
                   :args => [],
:bundle_dir_or_bundle_id => "/Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app",
              :bundle_id => "com.goinstant.internal.SOTesters",
          :device_target => "iPhone 6s Plus (9.3)",
            :instruments => #<Instruments 7.3>,
          :launch_method => :instruments,
         :launch_retries => 5,
               :log_file => "/Users/k/.run-loop/results/2016-03-29_22-23-14/run_loop.out",
              :no_launch => false,
                :no_stop => false,
     :relaunch_simulator => true,
                  :reset => false,
            :results_dir => "/Users/k/.run-loop/results/2016-03-29_22-23-14",
      :results_dir_trace => "/Users/k/.run-loop/results/2016-03-29_22-23-14/trace",
                 :script => "/Users/k/.run-loop/results/2016-03-29_22-23-14/_run_loop.js",
            :sdk_version => nil,
                   :udid => "iPhone 6s Plus (9.3)",
           :uia_strategy => :host,
                  :xcode => "7.3",
             :xcode_path => "/Applications/Xcode.app/Contents/Developer"
}
EXEC: xcrun instruments -s templates

### Starting on iPhone 6s Plus (9.3) App: /Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app ###
EXEC: xcrun instruments -s devices
2016-03-29 22:23:24 -0300 [RunLoop:debug]: xcrun instruments -w DDB1E8ED-025F-40E5-AF6C-1A99C30729B9 -D /Users/k/.run-loop/results/2016-03-29_22-23-14/trace -t Automation /Users/k/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphonesimulator/SOTesters.app -e UIARESULTSPATH /Users/k/.run-loop/results/2016-03-29_22-23-14 -e UIASCRIPT /Users/k/.run-loop/results/2016-03-29_22-23-14/_run_loop.js >& /Users/k/.run-loop/results/2016-03-29_22-23-14/run_loop.out
2016-03-29 22:23:24 -0300 [RunLoop:debug]: Preparation took 10.577951 seconds
2016-03-29 22:23:29 -0300 [RunLoop:debug]: Launching took 4.361413 seconds
DEBUG: It took 14.939501 seconds to launch the app
|

光标在那里等待并且不完整。

我必须 ctrl+c 并返回 irb&gt;

如果我在没有start_test_server_in_background 的情况下进行查询,我会收到超时错误

irb(main):001:0> query("*")
= Request

> ! CONNECT TO 10.10.10.10:37265
Retrying.. HTTPClient::ConnectTimeoutError: (execution expired)
= Request

`! CONNECT TO 10.10.10.10:37265
Retrying.. HTTPClient::ConnectTimeoutError: (execution expired)
= Request

> ! CONNECT TO 10.10.10.10:37265
Failing... HTTPClient::ConnectTimeoutError
HTTPClient::ConnectTimeoutError: execution expired

我基本上遵循了https://github.com/calabash/calabash-ios/wiki/Updating-your-Calabash-iOS-version上的所有说明

服务器版本和gem版本都是0.18.2还是连接不上。我尝试在其他模拟器上运行,我得到了相同的连接超时错误。

【问题讨论】:

    标签: calabash calabash-ios


    【解决方案1】:

    +1 表示包含所有相关信息。

    您的curl 反对localhost,但堆栈跟踪显示:10.10.10.10:37265。这意味着您环境中的某处DEVICE_ENDPOINT 设置为“http://10.10.10.10:37265”。

    您正在启动 Calabash 控制台,DEVICE_ENDPOINT=http://10.10.10.10:37265DEVICE_ENDPOINT 已在您的 shell 中导出。

    试试:

    $ DEVICE_ENDPOINT="http://localhost:37265" calabash-ios console
    > start_test_server_in_background
    

    你可以检查DEVICE_ENDPOINT是否已经在你的shell中定义了:

    $ echo $DEVICE_ENDPOINT
    

    【讨论】:

    • 约书亚,你是对的。我在 shell 中定义了 $DEVICE_ENDPOINT 来在真实设备上启动服务器。我的印象是运行模拟器不会使用设备端点。我在 shell 中删除了它并执行了源命令并关闭了终端,但它没有用。我不得不重新启动我的机器,现在问题已经解决了。感谢您的回复!
    【解决方案2】:

    irb 中运行query() 之前,您是否start_test_server_in_background?在 calabash 与您的应用程序交互之前,必须进行一个相当复杂的附加过程。

    【讨论】:

    • 我在irb 中运行query() 之前尝试了start_test_server_in_background
    • 好的,那么您介意发布完整的警告/错误日志吗?
    • 我在irb 中运行query() 之前尝试了start_test_server_in_background。它在模拟器上启动应用程序,它只是在等待一些东西。只有 ctrl+c 将我返回到irb&gt;。我无法在那里查询,所以我尝试了上述可重现的步骤来查看它实际上做了什么,我得到了连接超时错误
    • 好的,如果你运行start_test_server_in_background 然后等待(可能一两分钟),它会给你一个错误/堆栈跟踪吗?有一些关于各种奇怪问题的热门话题可能会有所帮助 -> github.com/calabash/calabash-ios/wiki/Hot-Topics
    猜你喜欢
    • 2011-08-19
    • 1970-01-01
    • 2011-09-14
    • 2012-07-12
    • 1970-01-01
    • 1970-01-01
    • 2018-08-23
    • 1970-01-01
    • 2019-04-22
    相关资源
    最近更新 更多