Skip to content

Commit b3898ba

Browse files
adsamcikCopilot
andcommitted
test(logger): declare LoggerLifecycleRaceTest @test return type as Unit
Two of the four new tests had unBlocking { ... shouldBe true } as their expression body. Kotlin inferred the return type as Boolean, the compiler emitted public final boolean reinitAfterShutdownSucceeds(), and JUnit Jupiter silently skipped both methods (it only discovers @test methods that return void/Unit). Tests passed locally because they were never discovered. Adds explicit : Unit to all four @test fun ...() = runBlocking { ... } declarations so the compiler always emits a �oid JVM signature, guaranteeing discovery. Verified: TEST-LoggerLifecycleRaceTest\.xml now reports tests=2 (was 1); TEST-LoggerLifecycleRaceTest\.xml stays at tests=2; all four pass. Follows up d09ce91. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f1c4d02 commit b3898ba

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

logger/src/test/java/com/adsamcik/tracker/logger/LoggerLifecycleRaceTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class LoggerLifecycleRaceTest {
102102

103103
@Test
104104
@DisplayName("leaves state fully reset and does not repopulate globals")
105-
fun shutdownDuringInitLeavesStateReset() = runBlocking {
105+
fun shutdownDuringInitLeavesStateReset(): Unit = runBlocking {
106106
stubInitDependencies()
107107
val ctx = mockk<Context>(relaxed = true)
108108

@@ -137,7 +137,7 @@ class LoggerLifecycleRaceTest {
137137

138138
@Test
139139
@DisplayName("second initialize after shutdown succeeds with fresh state")
140-
fun reinitAfterShutdownSucceeds() = runBlocking {
140+
fun reinitAfterShutdownSucceeds(): Unit = runBlocking {
141141
stubInitDependencies()
142142
val ctx = mockk<Context>(relaxed = true)
143143

@@ -162,7 +162,7 @@ class LoggerLifecycleRaceTest {
162162

163163
@Test
164164
@DisplayName("runs the init body exactly once under 16-way contention")
165-
fun concurrentInitRunsBodyExactlyOnce() = runBlocking {
165+
fun concurrentInitRunsBodyExactlyOnce(): Unit = runBlocking {
166166
stubInitDependencies()
167167
val ctx = mockk<Context>(relaxed = true)
168168

@@ -192,7 +192,7 @@ class LoggerLifecycleRaceTest {
192192

193193
@Test
194194
@DisplayName("post-init calls short-circuit on the volatile flag")
195-
fun postInitCallsShortCircuit() = runBlocking {
195+
fun postInitCallsShortCircuit(): Unit = runBlocking {
196196
stubInitDependencies()
197197
val ctx = mockk<Context>(relaxed = true)
198198

0 commit comments

Comments
 (0)