gpt4 book ai didi

Android测试用例等待10分钟后才能在debug模式下调试

转载 作者:行者123 更新时间:2023-12-02 12:03:00 26 4
gpt4 key购买 nike

它以前工作过。但现在已经不行了。 IDE 只显示“实例化测试...”。但是当我等了 10 分钟时,它突然就起作用了?机器是 Macbook Pro,2015 年中。问题仅出现在 androidTest , test目录工作正常。

@LargeTest
@RunWith(AndroidJUnit4::class)
class SomeTestClass {

@get:Rule
var activityTestRule = ActivityTestRule(
NavigationActivity::class.java, false, false)

@Before
fun before() {
Timber.d("When debugging, this triggers only after about 10 minutes.")
}

@Test
fun testContents() {
Assert.assertEquals(0, 0)
}
}
日志不断输出:
D/EZIO_NLOG: watchdog_routine executed!
D/EZIO_NLOG: check1
check1
check2
check2
尝试了以下事情:
  • 文件,使缓存无效/重新启动
  • 试过this answer .但它似乎已经过时了。
  • 编辑配置...,选择“All in Package”、“Class”和“Method”。它们都不起作用。
  • 当我等了很长时间,比如 10 分钟,然后突然之间它就会触发并起作用。

  • enter image description here
    enter image description here

    最佳答案

    Android 测试很慢,并且在该调试器之上增加了更多负载。我遇到了同样的问题,我同意使用带有 Android 测试的调试器是一件痛苦的事情。
    以下是我发现的 hereEspresso detects when the main thread is idle, so it is able to run your test commands at the appropriate time, improving the reliability of your tests.最重要的是,当添加调试器时,它会变得更慢。
    您可以尝试在真实设备上运行测试,它应该更快(我假设)

    关于Android测试用例等待10分钟后才能在debug模式下调试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63396312/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com