From 5a571384029cf5607acdb62b5b1576593bc78f59 Mon Sep 17 00:00:00 2001 From: ZhuchkaTriplesix Date: Fri, 9 Oct 2026 11:29:27 +0300 Subject: [PATCH] test(e2e): let database requests finish before the harness advances time The harness closes an app by advancing the fake clock in 10 s steps. A database request still in flight then trips sqflite's 10 s "database has been locked" warning, eleven times per run in the smoke and palette suites. The app holds no lock there, so the warning is noise: the harness now lets real requests finish before it advances the fake clock. --- test/e2e/helpers/e2e_app_harness.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/e2e/helpers/e2e_app_harness.dart b/test/e2e/helpers/e2e_app_harness.dart index d070459f..52d4d5d8 100644 --- a/test/e2e/helpers/e2e_app_harness.dart +++ b/test/e2e/helpers/e2e_app_harness.dart @@ -79,6 +79,13 @@ class E2eAppHarness { /// without "Timer is still pending" failures. Call at the end of a scenario. Future close(WidgetTester tester) async { await tester.pumpWidget(const material.SizedBox.shrink()); + // Let the database requests still in flight finish in real time first. + // Advancing the fake clock in 10 s steps while one is pending fires + // sqflite's "database has been locked" warning, which is noise here: the + // app holds no lock. + await tester.runAsync( + () => Future.delayed(const Duration(milliseconds: 500)), + ); for (var i = 0; i < 6; i++) { await tester.pump(const Duration(seconds: 10)); }