Wednesday, 19 August 2020

Android Test cases can only be debugged in debug mode after 10 minutes of waiting

It was working before. But now it doesn't anymore. The IDE just shows "Instantiating tests...". But when I wait for 10 minutes, then all of a sudden it does work? The machine is a Macbook Pro, Mid 2015. The problem only occurs on androidTest, the test directory works fine.

@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)
    }    
}

The log keeps outputting this:

D/EZIO_NLOG: watchdog_routine executed!
D/EZIO_NLOG: check1 
    check1 
    check2 
    check2 

Tried the following things:

  1. File, Invalidate Cache / Restart
  2. Tried this answer. But it seems to be outdated.
  3. Edit Configurations..., Selected "All in Package", "Class" and "Method". None of them work.
  4. When I wait really long, like 10 minutes, then all of a sudden it triggers and works.

enter image description here enter image description here



from Android Test cases can only be debugged in debug mode after 10 minutes of waiting

No comments:

Post a Comment