RejectedExecutionException for roboelectric tests in Android Unit Test

I am running a development workflow for my Android project and executing unit test cases on release build variant.
All my test runs fine but few of roboelectric tests are failing.
Logs are as follows :

java.util.concurrent.RejectedExecutionException: Task org.robolectric.shadows.ShadowLegacyAsyncTask$3@3eb06764 rejected from java.util.concurrent.ThreadPoolExecutor@a3da6e8[Running, pool size = 5, active threads = 5, queued tasks = 128, completed tasks = 15]
at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(
at java.util.concurrent.ThreadPoolExecutor.reject(
at java.util.concurrent.ThreadPoolExecutor.execute(
at org.robolectric.shadows.ShadowLegacyAsyncTask.executeOnExecutor(
at android.os.AsyncTask.executeOnExecutor(
at com.mindvalley.mva.controller.util.helpers.AnalyticsHelper.initialize(AnalyticsHelper.kt:62)
at com.mindvalley.mva.common.MVApplication.onCreate(MVApplication.kt:109)
at com.mindvalley.mva.common.MockApplication.onCreate(MockApplication.kt:12)
at org.robolectric.util.PerfStatsCollector.measure(
at org.robolectric.RobolectricTestRunner.beforeTest(
at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(
at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

Command to run tests : ./gradlew testmvaReleaseUnitTest

Roboelectric test configuration :

@Config(sdk = [Build.VERSION_CODES.O_MR1], manifest = Config.NONE, application = MockApplication::class)

Hi @harsh.signin!

Can you please fill out the issue report template and include the build’s URL? That allows us to take a look at the logs and we aren’t able to assist otherwise. Thanks!

My build URL is
Can you help me where to find issue report template.

Thanks, we’ll be taking a look! The template is my bad, it’s present when you open a new thread in the #issues:build-issues category but not here in the #issues:steps-and-tool-issues.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.