diff --git a/integration_test/matrix_service_test.dart b/integration_test/matrix_service_test.dart index 359aa8303..ad0d124ea 100644 --- a/integration_test/matrix_service_test.dart +++ b/integration_test/matrix_service_test.dart @@ -57,8 +57,14 @@ void main() { ..registerSingleton(mockUpdateNotifications) ..registerSingleton(UserActivityService()); - final aliceDb = JournalDb(overriddenFilename: 'alice_db.sqlite'); - final bobDb = JournalDb(overriddenFilename: 'bob_db.sqlite'); + final aliceDb = JournalDb( + overriddenFilename: 'alice_db.sqlite', + inMemoryDatabase: true, + ); + final bobDb = JournalDb( + overriddenFilename: 'bob_db.sqlite', + inMemoryDatabase: true, + ); const testSlowNetwork = bool.fromEnvironment(testSlowNetworkEnv); @@ -115,7 +121,7 @@ void main() { ..registerSingleton(docDir) ..registerSingleton(LoggingDb(inMemoryDatabase: true)) ..registerSingleton(JournalDb(inMemoryDatabase: true)) - ..registerSingleton(mockSettingsDb) + ..registerSingleton(SettingsDb(inMemoryDatabase: true)) ..registerSingleton(secureStorageMock); when(() => mockSettingsDb.itemByKey(any())).thenAnswer((_) async => null); @@ -319,7 +325,10 @@ void main() { } await waitUntilAsync( - () async => await aliceDb.getJournalCount() == n, + () async { + final currentCount = await aliceDb.getJournalCount(); + return currentCount == n; + }, ); debugPrint('\n--- Alice finished receiving messages'); final aliceEntriesCount = await aliceDb.getJournalCount();