From faa7956b93e3e055247c600b90ada971160af9df Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 14 Oct 2026 14:46:15 +0200 Subject: [PATCH] Fix flaky NotificationSettingsPresenterTest after loading distributors off the main thread The distributors are now loaded on the IO dispatcher, which was a StandardTestDispatcher in the test, so the initial state could be read before they were loaded. Use an unconfined test dispatcher so that they are loaded deterministically. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../impl/notifications/NotificationSettingsPresenterTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsPresenterTest.kt b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsPresenterTest.kt index e37d39d775..ed65f9a9f3 100644 --- a/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsPresenterTest.kt +++ b/features/preferences/impl/src/test/kotlin/io/element/android/features/preferences/impl/notifications/NotificationSettingsPresenterTest.kt @@ -1177,7 +1177,7 @@ class NotificationSettingsPresenterTest { stringProvider = FakeStringProvider(), sessionCoroutineScope = backgroundScope, featureFlagService = featureFlagService, - dispatchers = testCoroutineDispatchers(), + dispatchers = testCoroutineDispatchers(useUnconfinedTestDispatcher = true), ) } }