【问题标题】:Failure to run detox tests due to timeout during the application installation由于在应用程序安装期间超时而无法运行排毒测试
【发布时间】:2021-01-19 17:42:40
【问题描述】:

尝试在云 (AWS) 中配置的机器上运行测试时,我在应用程序安装期间遇到超时错误。

--loglevel trace 的输出显示如下:

detox[7183] DEBUG: [exec.js/EXEC_CMD, #16] "/opt/android-sdk/platform-tools/adb" -s emulator-5554 shell "pm install -r -g -t /data/local/tmp/detox/Application.apk"
detox[7183] WARN:  at e2e/utils/testRail.js:49:25
 Creating a new Run in TestRail has failed with the following error
{}
detox[7183] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR]
 { DetoxRuntimeError: Aborted detox.init() execution, and now running detox.cleanup()

HINT: Most likely, your test runner is tearing down the suite due to the timeout error
    at Detox.[_assertNoPendingInit] (/home/fundbox/mobileNative/node_modules/detox/src/Detox.js:204:9)
    at Detox.beforeEach (/home/fundbox/mobileNative/node_modules/detox/src/Detox.js:111:37)
    at DetoxExportWrapper.(anonymous function).args [as beforeEach] (/home/fundbox/mobileNative/node_modules/detox/src/DetoxExportWrapper.js:87:32)
    at DetoxAdapterImpl.beforeEach (/home/fundbox/mobileNative/node_modules/detox/runners/jest/DetoxAdapterImpl.js:28:22)
    at process._tickCallback (internal/process/next_tick.js:68:7) name: 'DetoxRuntimeError' }

但是,当我手动运行安装命令时,它会成功。 time命令显示安装耗时1m51s:

$ time /opt/android-sdk/platform-tools/adb -s emulator-5554 shell "pm install -r -g -t /data/local/tmp/detox/Application.apk"
Success

real    1m51.100s
user    0m0.000s
sys 0m0.000s

有没有办法为此步骤或全局配置和增加超时?

【问题讨论】:

    标签: android detox


    【解决方案1】:

    我好像找到了那个地方。显然,有一个文件可以配置超时常量e2e/consts.js

    以下地点看起来相关:

    exports.wait = 2000;
    exports.timeout = 30000;
    exports.jestTimeout = 120000;
    

    我将exports.jestTimeout 的值更新为更高的值,并且测试能够通过有问题的步骤。

    【讨论】:

      猜你喜欢
      • 2021-06-21
      • 2017-07-23
      • 1970-01-01
      • 2021-07-04
      • 2018-06-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-29
      相关资源
      最近更新 更多