Increase timeout. Log timeout.

This commit is contained in:
Michael Kaye 2022-05-13 16:06:47 +01:00
parent 78140af3f3
commit 70682b4931
2 changed files with 5 additions and 2 deletions

View File

@ -378,7 +378,10 @@ class CommonTestHelper(context: Context) {
* @throws InterruptedException
*/
fun await(latch: CountDownLatch, timeout: Long? = TestConstants.timeOutMillis) {
assertTrue(latch.await(timeout ?: TestConstants.timeOutMillis, TimeUnit.MILLISECONDS))
assertTrue(
"Timed out after " + timeout + "ms waiting for something to happen. See stacktrace for cause.",
latch.await( timeout ?: TestConstants.timeOutMillis, TimeUnit.MILLISECONDS)
)
}
suspend fun retryPeriodicallyWithLatch(latch: CountDownLatch, condition: (() -> Boolean)) {

View File

@ -23,7 +23,7 @@ object TestConstants {
const val TESTS_HOME_SERVER_URL = "http://10.0.2.2:8080"
// Time out to use when waiting for server response.
private const val AWAIT_TIME_OUT_MILLIS = 60_000
private const val AWAIT_TIME_OUT_MILLIS = 120_000
// Time out to use when waiting for server response, when the debugger is connected. 10 minutes
private const val AWAIT_TIME_OUT_WITH_DEBUGGER_MILLIS = 10 * 60_000