making all waitForViews have an initial 100ms wait this completely removed the flakyness when running the tests on my emulator

This commit is contained in:
Adam Brown 2021-11-05 13:29:16 +00:00
parent f08d3965c1
commit d2aec09b5b
1 changed files with 4 additions and 0 deletions

View File

@ -70,6 +70,8 @@ fun waitForView(viewMatcher: Matcher<View>, timeout: Long = 10_000, waitForDispl
val endTime = startTime + timeout
val visibleMatcher = isDisplayed()
uiController.loopMainThreadForAtLeast(100)
do {
println("*** waitForView loop $view end:$endTime current:${System.currentTimeMillis()}")
val viewVisible = TreeIterables.breadthFirstViewTraversal(view)
@ -93,6 +95,8 @@ fun waitForView(viewMatcher: Matcher<View>, timeout: Long = 10_000, waitForDispl
}
}
fun initialSyncIdlingResource(session: Session): IdlingResource {
val res = object : IdlingResource, Observer<SyncState> {
private var callback: IdlingResource.ResourceCallback? = null