question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Runner times out and gets stuck instead of exiting

See original GitHub issue

It seems to get stuck and never stop running, leading to me cancelling it manually. It happens nearly every time, too. Error log of what I think are the relevant portions:

38% | [omni]-[EMULATOR29X3X4X0] com.<snip>.TestClass#testSomeStuff started 
E 09:58:57.529 [ScreenCapturer - EMULATOR29X3X4X0 @coroutine#274] <ScreenCapturer> Timeout. Exiting 
com.android.ddmlib.TimeoutException: null 
at com.android.ddmlib.AdbHelper.read(AdbHelper.java:867) 
at com.android.ddmlib.AdbHelper.getFrameBuffer(AdbHelper.java:328) 
at com.android.ddmlib.Device.getScreenshot(Device.java:493) 
at com.malinskiy.marathon.android.executor.listeners.screenshot.ScreenCapturer.getScreenshot(ScreenCapturer.kt:53) 
at com.malinskiy.marathon.android.executor.listeners.screenshot.ScreenCapturer.access$getScreenshot(ScreenCapturer.kt:27) 
at com.malinskiy.marathon.android.executor.listeners.screenshot.ScreenCapturer$start$2.invokeSuspend(ScreenCapturer.kt:39) 
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
at kotlinx.coroutines.ResumeModeKt.resumeMode(ResumeMode.kt:67) 
at kotlinx.coroutines.DispatchedKt.resume(Dispatched.kt:319) 
at kotlinx.coroutines.DispatchedKt.dispatch(Dispatched.kt:301) 
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:250) 
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:260) 
at kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched(CancellableContinuationImpl.kt:332) 
at kotlinx.coroutines.ResumeUndispatchedRunnable.run(Executors.kt:135) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
at java.lang.Thread.run(Thread.java:748) 
D 09:58:58.958 [AndroidDevice - execution - emulator-5554 @coroutine#273] <ScreenCapturerTestRunListener> Finished recording for TestClass#testSomeStuff 
I 09:58:59.062 [AndroidDevice - execution - emulator-5554 @coroutine#273] <DebugTestRunListener> testEnded EMULATOR29X3X4X0 test = com.<snip>.TestClass#testSomeStuff 
39% | [omni]-[EMULATOR29X3X4X0] com.<snip>.TestClass#testSomeStuff ended 
I 09:59:03.274 [AndroidDevice - execution - emulator-5554 @coroutine#273] <DebugTestRunListener> testRunEnded elapsedTime 7090 
D 09:59:03.275 [main @coroutine#6] <QueueActor[DevicePoolId(name=omni)]> handle test results EMULATOR29X3X4X0 
D 09:59:03.275 [main @coroutine#6] <QueueActor[DevicePoolId(name=omni)]> request next batch for device EMULATOR29X3X4X0 
D 09:59:03.275 [main @coroutine#6] <QueueActor[DevicePoolId(name=omni)]> sending next batch for device EMULATOR29X3X4X0 
D 09:59:03.275 [main @coroutine#7] <DevicePool[omni]_DeviceActor[EMULATOR29X3X4X0]> executeBatch EMULATOR29X3X4X0 
D 09:59:03.277 [AndroidDevice - execution - emulator-5554 @coroutine#278] <AndroidDeviceTestRunner> tests = [com.<snip>.TestClass#testSomeStuff] 
E 10:01:38.642 [ScreenCapturer - EMULATOR29X3X4X0 @coroutine#274] <ScreenCapturer> Timeout. Exiting
com.android.ddmlib.TimeoutException: null 
at com.android.ddmlib.AdbHelper.read(AdbHelper.java:867) 
at com.android.ddmlib.AdbHelper.read(AdbHelper.java:836) 
at com.android.ddmlib.AdbHelper.readAdbResponse(AdbHelper.java:215) 
at com.android.ddmlib.AdbHelper.getFrameBuffer(AdbHelper.java:291) 
at com.android.ddmlib.Device.getScreenshot(Device.java:493) 
at com.malinskiy.marathon.android.executor.listeners.screenshot.ScreenCapturer.getScreenshot(ScreenCapturer.kt:53) 
at com.malinskiy.marathon.android.executor.listeners.screenshot.ScreenCapturer.access$getScreenshot(ScreenCapturer.kt:27) 
at com.malinskiy.marathon.android.executor.listeners.screenshot.ScreenCapturer$start$2.invokeSuspend(ScreenCapturer.kt:39) 
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
at kotlinx.coroutines.ResumeModeKt.resumeMode(ResumeMode.kt:67) 
at kotlinx.coroutines.DispatchedKt.resume(Dispatched.kt:319) 
at kotlinx.coroutines.DispatchedKt.dispatch(Dispatched.kt:301) 
at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:250) 
at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:260) 
at kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched(CancellableContinuationImpl.kt:332) 
at kotlinx.coroutines.ResumeUndispatchedRunnable.run(Executors.kt:135) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 
at java.lang.Thread.run(Thread.java:748) 
I 10:01:45.784 [AndroidDevice - execution - emulator-5554 @coroutine#278] <DebugTestRunListener> testRunStarted EMULATOR29X3X4X0
W 10:01:45.785 [AndroidDevice - execution - emulator-5554 @coroutine#278] <TestRunResultsListener> uncompleted = com.<snip>.TestClass#testSomeStuff, EMULATOR29X3X4X0 
I 10:01:45.785 [AndroidDevice - execution - emulator-5554 @coroutine#278] <DebugTestRunListener> testRunFailed EMULATOR29X3X4X0 errorMessage = com.android.ddmlib.TimeoutException 
W 10:01:45.786 [AndroidDevice - execution - emulator-5554 @coroutine#278] <TestRunResultsListener> uncompleted = com.<snip>.TestClass#testSomeStuff, EMULATOR29X3X4X0 
I 10:01:45.786 [AndroidDevice - execution - emulator-5554 @coroutine#278] <DebugTestRunListener> testRunEnded elapsedTime 0 
W 10:01:45.786 [AndroidDevice - execution - emulator-5554 @coroutine#278] <AndroidDeviceTestRunner> Test got stuck. You can increase the timeout in settings if it's too strict 
W 10:01:45.786 [AndroidDevice - execution - emulator-5554 @coroutine#278] <TestRunResultsListener> uncompleted = com.<snip>.TestClass#testSomeStuff, EMULATOR29X3X4X0 
I 10:01:45.786 [AndroidDevice - execution - emulator-5554 @coroutine#278] <DebugTestRunListener> testRunFailed EMULATOR29X3X4X0 errorMessage = Test got stuck. You can increase the timeout in settings if it's too strict 
D 10:01:45.787 [main @coroutine#6] <QueueActor[DevicePoolId(name=omni)]> handle test results EMULATOR29X3X4X0 
D 10:01:45.787 [main @coroutine#6] <QueueActor[DevicePoolId(name=omni)]> handle failed tests EMULATOR29X3X4X0 
D 10:01:45.787 [main @coroutine#6] <QueueActor[DevicePoolId(name=omni)]> request next batch for device EMULATOR29X3X4X0 
D 10:01:45.787 [main @coroutine#6] <QueueActor[DevicePoolId(name=omni)]> sending next batch for device EMULATOR29X3X4X0 
D 10:01:45.787 [main @coroutine#5] <DevicePoolActor[omni]> Notify devices 
D 10:01:45.787 [main @coroutine#7] <DevicePool[omni]_DeviceActor[EMULATOR29X3X4X0]> executeBatch EMULATOR29X3X4X0 
D 10:01:45.788 [AndroidDevice - execution - emulator-5554 @coroutine#283] <AndroidDeviceTestRunner> tests = [com.<snip>.TestClass#testSomeStuff] 
I 10:04:46.502 [AndroidDevice - execution - emulator-5554 @coroutine#283] <DebugTestRunListener> testRunStarted EMULATOR29X3X4X0 
W 10:04:46.502 [AndroidDevice - execution - emulator-5554 @coroutine#283] <TestRunResultsListener> uncompleted = com.<snip>.TestClass#testSomeStuff, EMULATOR29X3X4X0 
I 10:04:46.502 [AndroidDevice - execution - emulator-5554 @coroutine#283] <DebugTestRunListener> testRunFailed EMULATOR29X3X4X0 errorMessage = com.android.ddmlib.TimeoutException 
W 10:04:46.503 [AndroidDevice - execution - emulator-5554 @coroutine#283] <TestRunResultsListener> uncompleted = com.<snip>.TestClass#testSomeStuff, EMULATOR29X3X4X0 
I 10:04:46.504 [AndroidDevice - execution - emulator-5554 @coroutine#283] <DebugTestRunListener> testRunEnded elapsedTime 0 
W 10:04:46.504 [AndroidDevice - execution - emulator-5554 @coroutine#283] <AndroidDeviceTestRunner> Test got stuck. You can increase the timeout in settings if it's too strict 
W 10:04:46.504 [AndroidDevice - execution - emulator-5554 @coroutine#283] <TestRunResultsListener> uncompleted = com.<snip>.TestClass#testSomeStuff, EMULATOR29X3X4X0 
I 10:04:46.504 [AndroidDevice - execution - emulator-5554 @coroutine#283] <DebugTestRunListener> testRunFailed EMULATOR29X3X4X0 errorMessage = Test got stuck. You can increase the timeout in settings if it's too strict 
D 10:04:46.504 [main @coroutine#6] <QueueActor[DevicePoolId(name=omni)]> handle test results EMULATOR29X3X4X0 
D 10:04:46.504 [main @coroutine#6] <QueueActor[DevicePoolId(name=omni)]> handle failed tests EMULATOR29X3X4X0 
D 10:04:46.505 [main @coroutine#6] <QueueActor[DevicePoolId(name=omni)]> request next batch for device EMULATOR29X3X4X0 
D 10:04:46.505 [main @coroutine#6] <QueueActor[DevicePoolId(name=omni)]> sending next batch for device EMULATOR29X3X4X0 

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Malinskiycommented, Jan 26, 2022

@cosic from the log you’ve attached you have a test that takes longer to execute than 2 minutes. Since you have 1 uncompleted retry quota it tries again and fails in a bit more than 4 minutes. I’d suggest either increasing the test timeout for the batch or investigating why your device can’t finish the test (screenshots, video, logs)

Check the timestamps below in the relevant section of the log. You can also just call adb am instrument -w -r --no-window-animation -e class ru.app.android.test.mock.newbuilding.promosearch.PromoSearchListingUiTest#openAndCheckPromoSearchListingScreen -e listener ru.app.uitest.leak.CustomFailTestOnLeakRunListener ru.app.main.debug.test/ru.app.uitest.runner.AppUiTestRunner to reproduce this problem without marathon.

D 23:00:56.912 [AndroidDevice - execution - 127.0.0.1:5037:UBV0218906001002-1 @coroutine#77] <AndroidDeviceTestRunner> Running 0127shell:am instrument -w -r --no-window-animation -e class ru.app.android.test.mock.newbuilding.promosearch.PromoSearchListingUiTest#openAndCheckPromoSearchListingScreen -e listener ru.app.uitest.leak.CustomFailTestOnLeakRunListener ru.app.main.debug.test/ru.app.uitest.runner.AppUiTestRunner
I 23:02:56.989 [AndroidDevice - execution - 127.0.0.1:5037:UBV0218906001002-2 @coroutine#77] <DebugTestRunListener> testRunFailed 127.0.0.1:5037:UBV0218906001002 errorMessage = Test got stuck. You can increase the timeout in settings if it's too strict
W 23:02:56.994 [AndroidDevice - execution - 127.0.0.1:5037:UBV0218906001002-2 @coroutine#77] <TestRunResultsListener> uncompleted = ru.app.android.test.mock.newbuilding.promosearch.PromoSearchListingUiTest#openAndCheckPromoSearchListingScreen, 127.0.0.1:5037:UBV0218906001002
0reactions
cosiccommented, Jan 27, 2022

@Malinskiy Thx! I’ve found mistake. You made me think. Correct command to start ui test by adb in my case:

adb shell am instrument -w -r --no-window-animation \
-e class ru.app.android.test.mock.newbuilding.promosearch.PromoSearchListingUiTest#openAndCheckPromoSearchListingScreen \
-e listener ru.app.uitest.leak.CustomFailTestOnLeakRunListener ru.app.main.debug.test/ru.app.uitest.runner.AppUiTestRunner

and it works as well. So I asked myself what java version I use. It turned out that 11.0.12 (x86_64) "Oracle Corporation". I changed it on 11.0.12 (arm64) "OpenJDK" and It works now and more quickly than before.

Read more comments on GitHub >

github_iconTop Results From Across the Web

k8s runner sometime have hanged jobs, it didnt finish ... - GitLab
while it hangs, I exec into the runner pod, and saw the logs are complete, the corresponding stage is finished. the runner log...
Read more >
GitHub Actions self-hosted runner keeps stuck between jobs
Typically all runners get stuck at the same time or very close to each other, but sometimes some are stuck and some continue...
Read more >
ProcessStartInfo hanging on "WaitForExit"? Why?
Running it in the Windows console works fine. Unfortunately programmatically this hangs indefinitely at WaitForExit . Note also this code does NOT hang...
Read more >
Timeout Command - Stop Command After X Seconds - Putorius
In this tutorial we will discuss the timeout command. This utility allows you to exit a command after it runs for x number...
Read more >
Common Reasons Why Connections Stay Open for a Long ...
Embedded getConnection Requests. Because WebSphere Application Server (WAS) pools connections, a connection in the free pool for a long period of time is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found