diff --git a/test/test_helpers/prefs.dart b/test/test_helpers/prefs.dart index b53b9c95..be8c5a25 100644 --- a/test/test_helpers/prefs.dart +++ b/test/test_helpers/prefs.dart @@ -1,5 +1,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:plezy/services/base_shared_preferences_service.dart'; +import 'package:plezy/services/prefs_recovery.dart'; import 'package:plezy/services/settings_service.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences_platform_interface/in_memory_shared_preferences_async.dart'; @@ -17,8 +18,18 @@ void resetSharedPreferencesForTest({Map initialAsync = const {}} SharedPreferences.resetStatic(); SettingsService.resetForTesting(); BaseSharedPreferencesService.resetForTesting(); + PrefsRecovery.debugSetSupportedPlatformOverride(null); }); TestWidgetsFlutterBinding.ensureInitialized(); + // The desktop store preflight (`PrefsRecovery.assertStoreReadable`) reads + // the real on-disk store through path_provider. These fixtures replace the + // preference backends with in-memory fakes, so there is no real store to + // validate — and on the hosts where the preflight is active (Linux and + // Windows) its genuine file IO can never complete inside `testWidgets`' + // fake async zone, deadlocking every widget test that initialises settings + // until the ten-minute timeout. Suites that exercise the preflight itself + // (`prefs_store_repair_flow_test.dart`) opt back in explicitly. + PrefsRecovery.debugSetSupportedPlatformOverride(false); SharedPreferences.setMockInitialValues({}); SharedPreferencesAsyncPlatform.instance = initialAsync.isEmpty ? InMemorySharedPreferencesAsync.empty()