Skip to content

Add unit test to verify the worker and update are properly invoked

6af7901
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

Add start workers in LaunchActivity #6720

Add unit test to verify the worker and update are properly invoked
6af7901
Select commit
Loading
Failed to load commit list.
GitHub Actions / Test Results failed Apr 22, 2026 in 0s

1 fail, 1 786 pass in 9m 53s

  232 files  +1    240 suites  +1   9m 53s ⏱️ +3s
1 787 tests +2  1 786 ✅ +2  0 💤 ±0  1 ❌ ±0 
1 858 runs  +2  1 856 ✅ +2  0 💤 ±0  2 ❌ ±0 

Results for commit 6af7901. ± Comparison against earlier commit fbb8e95.

Annotations

Check warning on line 0 in io.homeassistant.companion.android.launch.LaunchActivityTest

See this annotation in the file changed.

@github-actions github-actions / Test Results

2 out of 8 runs failed: launchActivity (io.homeassistant.companion.android.launch.LaunchActivityTest)

Instrumentation test (API23) google_apis results/app/build/outputs/androidTest-results/connected/debug/flavors/full/TEST-emulator-5554 - 6.0-_app-full.xml [took 14s]
Instrumentation test (API23) google_apis results/app/build/outputs/androidTest-results/connected/debug/flavors/minimal/TEST-emulator-5554 - 6.0-_app-minimal.xml [took 14s]
Raw output
leakcanary.NoLeakAssertionFailedError: Application memory leaks were detected:
====================================
HEAP ANALYSIS RESULT
====================================
1 APPLICATION LEAKS

References underlined with "~~~" are likely causes.
Learn more at https://squ.re/leaks.

831 bytes retained by leaking objects
Signature: 6491376cfe66b1cac0d47b3ae180fd9027019aa5
┬───
│ GC Root: Global variable in native code
│
├─ android.app.job.JobService$1 instance
│    Leaking: UNKNOWN
│    Retaining 859 B in 17 objects
│    Anonymous subclass of android.app.job.IJobService$Stub
│    this$0 instance of androidx.work.impl.background.systemjob.SystemJobService
│    ↓ JobService$1.this$0
│                   ~~~~~~
╰→ androidx.work.impl.background.systemjob.SystemJobService instance
​     Leaking: YES (ObjectWatcher was watching this because androidx.work.impl.background.systemjob.SystemJobService received Service#onDestroy() callback and Service not held by ActivityThread)
​     Retaining 831 B in 16 objects
​     key = 9a7b247b-6293-45b4-91ea-0efea9bf4882
​     watchDurationMillis = 5446
​     retainedDurationMillis = 439
​     mApplication instance of io.homeassistant.companion.android.HomeAssistantApplication
​     mBase instance of android.app.ContextImpl
====================================
0 LIBRARY LEAKS

A Library Leak is a leak caused by a known bug in 3rd party code that you do not have control over.
See https://square.github.io/leakcanary/fundamentals-how-leakcanary-works/#4-categorizing-leaks
====================================
0 UNREACHABLE OBJECTS

An unreachable object is still in memory but LeakCanary could not find a strong reference path
from GC roots.
====================================
METADATA

Please include this in bug reports and Stack Overflow questions.

Build.VERSION.SDK_INT: 23
Build.MANUFACTURER: unknown
LeakCanary version: 2.14
App process name: io.homeassistant.companion.android.minimal.debug
Class count: 11371
Instance count: 146316
Primitive array count: 92606
Object array count: 15931
Thread count: 28
Heap total bytes: 22292176
Bitmap count: 7
Bitmap total bytes: 0
Large bitmap count: 0
Large bitmap total bytes: 0
Db 1: open /data/user/0/io.homeassistant.companion.android.minimal.debug/no_backup/androidx.work.workdb
Db 2: open /data/user/0/io.homeassistant.companion.android.minimal.debug/databases/HomeAssistantDB
Stats: LruCache[maxSize=3000,hits=55988,misses=104018,hitRate=34%] RandomAccess[bytes=6872469,reads=104018,travel=96047011922,range=21042838,size=31341731]
assertionTag: DetectLeaksAfterTestSuccess
waitForRetainedDurationMillis: 5110
totalDurationMillis: 12252
Analysis duration: 3841 ms
Heap dump file path: /data/user/0/io.homeassistant.companion.android.minimal.debug/files/instrumentation_tests_2026-04-22_19-55-48_216.hprof
Heap dump timestamp: 1776887755354
Heap dump duration: 574 ms
====================================
at leakcanary.NoLeakAssertionFailedError$Companion$throwOnApplicationLeaks$1.reportHeapAnalysis(NoLeakAssertionFailedError.kt:25)
at leakcanary.AndroidDetectLeaksAssert.runLeakChecks(AndroidDetectLeaksAssert.kt:95)
at leakcanary.AndroidDetectLeaksAssert.assertNoLeaks(AndroidDetectLeaksAssert.kt:34)
at leakcanary.LeakAssertions.assertNoLeaks(LeakAssertions.kt:21)
at leakcanary.DetectLeaksAfterTestSuccess$apply$1.evaluate(DetectLeaksAfterTestSuccess.kt:26)
at leakcanary.TestDescriptionHolder$wrap$1.evaluate(TestDescriptionHolder.kt:43)
at androidx.compose.ui.test.junit4.AndroidComposeTestRule$apply$testWithDisposal$1.evaluate(AndroidComposeTestRule.android.kt:322)
at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:54)
at androidx.compose.ui.test.junit4.AndroidComposeTestRule$apply$1$evaluate$1.invokeSuspend(AndroidComposeTestRule.android.kt:334)
at androidx.compose.ui.test.junit4.AndroidComposeTestRule$apply$1$evaluate$1.invoke(AndroidComposeTestRule.android.kt)
at androidx.compose.ui.test.junit4.AndroidComposeTestRule$apply$1$evaluate$1.invoke(AndroidComposeTestRule.android.kt)
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1$1$1$1.invokeSuspend(ComposeUiTest.android.kt:605)
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1$1$1$1.invoke(ComposeUiTest.android.kt)
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1$1$1$1.invoke(ComposeUiTest.android.kt)
at androidx.compose.ui.test.EspressoLink.withStrategy(EspressoLink.android.kt:69)
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1.invokeSuspend(ComposeUiTest.android.kt:602)
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1.invoke(ComposeUiTest.android.kt)
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment$runTest$1$1.invoke(ComposeUiTest.android.kt)
at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTest$2$1$1.invokeSuspend(TestBuilders.kt:317)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at kotlinx.coroutines.test.TestDispatcher.processEvent$kotlinx_coroutines_test(TestDispatcher.kt:24)
at kotlinx.coroutines.test.TestCoroutineScheduler.tryRunNextTaskUnless$kotlinx_coroutines_test(TestCoroutineScheduler.kt:99)
at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt$runTest$2$1$workRunner$1.invokeSuspend(TestBuilders.kt:326)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:263)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:94)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:70)
at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:48)
at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
at kotlinx.coroutines.test.TestBuildersJvmKt.createTestResult(TestBuildersJvm.kt:10)
at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:309)
at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0(Unknown Source)
at kotlinx.coroutines.test.TestBuildersKt__TestBuildersKt.runTest-8Mi8wO0(TestBuilders.kt:167)
at kotlinx.coroutines.test.TestBuildersKt.runTest-8Mi8wO0(Unknown Source)
at androidx.compose.ui.test.AndroidComposeUiTestEnvironment.runTest(ComposeUiTest.android.kt:585)
at androidx.compose.ui.test.junit4.AndroidComposeTestRule$apply$1.evaluate(AndroidComposeTestRule.android.kt:334)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:68)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:59)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:467)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)