office: stop the theme test chasing the auto-save loop forever
- Commit
63b7f5fe71d9d9826efb0c47c9a1f48b2506404f- Author
- Vayun Mathur <[email protected]>
- When
- 2026-11-21 07:32 UTC (15 days ago)
- Parents
2abaa68
The 'theme mode persists' test called loadSettings, which starts the (correctly default-on) auto-save loop on viewModelScope; that scope shares runTest's virtual scheduler, so teardown advanced virtual time forever chasing the infinite delay - the test executor spun and the office suite never finished (CI timeout). The test now stops auto-save after the assertion like its sibling already did. No production change: in the app the loop dies with viewModelScope as intended. Reproduced hung at 300s before; after: targeted class 16/16 and full :office:testDevUnitTest 1070 tests in 4m42s, 0 failures.
Diff
office/src/test/java/com/vayunmathur/office/platform/OfficeViewModelCoreSlice3Test.kt
diff --git a/office/src/test/java/com/vayunmathur/office/platform/OfficeViewModelCoreSlice3Test.kt b/office/src/test/java/com/vayunmathur/office/platform/OfficeViewModelCoreSlice3Test.ktindex 39fe5290ed..f4eb826006 100644--- a/office/src/test/java/com/vayunmathur/office/platform/OfficeViewModelCoreSlice3Test.kt+++ b/office/src/test/java/com/vayunmathur/office/platform/OfficeViewModelCoreSlice3Test.kt@@ -146,6 +146,10 @@ class OfficeViewModelCoreSlice3Test : OfficeViewModelSlice3Harness() { val vm2 = idleVm() vm2.loadSettings(app) assertEquals(OfficeViewModel.DocumentThemeMode.FOLLOW_SYSTEM, vm2.documentThemeMode.value)+ // loadSettings starts the (default-on) auto-save loop on viewModelScope;+ // cancel it, or runTest's teardown advanceUntilIdle chases the infinite+ // while(true){delay()} loop forever (same as in `saveSettings persists and restores`).+ vm2.setAutoSave(false) } @Test