From 246eac8cf87c821683155a0ec59858f162176ba1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Varga?= Date: Wed, 8 May 2024 23:36:50 +0200 Subject: [PATCH] chore: Unify Main Thread naming (#52) --- .../internal/JUnit5RobolectricAndroidSandbox.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/robolectric-extension/src/main/kotlin/tech/apter/junit/jupiter/robolectric/internal/JUnit5RobolectricAndroidSandbox.kt b/robolectric-extension/src/main/kotlin/tech/apter/junit/jupiter/robolectric/internal/JUnit5RobolectricAndroidSandbox.kt index 9107f55..520564a 100644 --- a/robolectric-extension/src/main/kotlin/tech/apter/junit/jupiter/robolectric/internal/JUnit5RobolectricAndroidSandbox.kt +++ b/robolectric-extension/src/main/kotlin/tech/apter/junit/jupiter/robolectric/internal/JUnit5RobolectricAndroidSandbox.kt @@ -15,6 +15,7 @@ internal class JUnit5RobolectricAndroidSandbox( compileSdk: Sdk, resourcesMode: ResourcesMode, apkLoader: ApkLoader, + @Suppress("VisibleForTests") testEnvironmentSpec: TestEnvironmentSpec, sdkSandboxClassLoader: SdkSandboxClassLoader, shadowProviders: ShadowProviders, @@ -30,9 +31,9 @@ internal class JUnit5RobolectricAndroidSandbox( sqLiteMode, ) { override fun mainThreadFactory(): ThreadFactory { - return ThreadFactory { r: Runnable? -> - val name = "${createThreadId()}-SDK-${sdk.apiLevel}" - Thread(ThreadGroup(name), r, "Main-Thread-$name") + return ThreadFactory { r: Runnable -> + val name = "SDK ${sdk.apiLevel}" + Thread(ThreadGroup(name), r, "$name Main Thread ${createThreadId()}") } }