Skip to content

Commit

Permalink
chore: Unify Main Thread naming (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
warnyul committed May 8, 2024
1 parent f604f87 commit 246eac8
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ internal class JUnit5RobolectricAndroidSandbox(
compileSdk: Sdk,
resourcesMode: ResourcesMode,
apkLoader: ApkLoader,
@Suppress("VisibleForTests")
testEnvironmentSpec: TestEnvironmentSpec,
sdkSandboxClassLoader: SdkSandboxClassLoader,
shadowProviders: ShadowProviders,
Expand All @@ -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()}")
}
}

Expand Down

0 comments on commit 246eac8

Please sign in to comment.