From 23b8befe118783734feaa4c44bcb1c71ffb934ba Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Wed, 5 Aug 2026 13:17:26 +0200 Subject: [PATCH] test(theme): load the deferred locale off the widget tester's fake clock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `await LocaleSettings.setLocale` inside a `testWidgets` body waits on a deferred library load that only completes on the real event loop, so the regex-dialog test hung indefinitely rather than failing. It passed only because an earlier plain `test` in the same file loads `de` first — running the file alone, under a name filter, or sharded apart from that test stalled the run until the ten-minute timeout. --- test/providers/theme_provider_test.dart | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/providers/theme_provider_test.dart b/test/providers/theme_provider_test.dart index b8e790d6..dac6221f 100644 --- a/test/providers/theme_provider_test.dart +++ b/test/providers/theme_provider_test.dart @@ -184,7 +184,12 @@ void main() { }); testWidgets('regex dialog localizes its field label and validation error', (tester) async { - await LocaleSettings.setLocale(AppLocale.de); + // `runAsync`: a deferred locale library loads on the real event loop, and + // the widget tester's fake async never pumps it. Awaiting the load + // directly hangs the test whenever the library is not already resident — + // running this file alone, under a name filter, or sharded away from the + // `themeModeLabel` test above that happens to load `de` first. + await tester.runAsync(() => LocaleSettings.setLocale(AppLocale.de)); addTearDown(() => LocaleSettings.setLocaleSync(AppLocale.en)); await tester.pumpWidget(