From 68d5ef98af4fef45cc833e446d8fa2aecf8464a8 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Mon, 16 Nov 2026 09:16:03 +0100 Subject: [PATCH] Let sandbox run test drain its late chimes run_screen_sandbox_test failed in flutter test: the kilometre chimes play after the vibrator probe answers, so the last ones can start audioplayers' frame callbacks after the final pump, and the framework reports them as running after the tree was disposed. The test now waits 300 ms and pumps twice before it ends. It failed the same way on 74a39c3, so it was not caused by the material_ui move. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WzxdWWfb63jncj9Lca2jeX --- .../test/screens/run_screen_sandbox_test.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stronglift_replacement/workout_app/test/screens/run_screen_sandbox_test.dart b/stronglift_replacement/workout_app/test/screens/run_screen_sandbox_test.dart index baca559..f8f7bb2 100644 --- a/stronglift_replacement/workout_app/test/screens/run_screen_sandbox_test.dart +++ b/stronglift_replacement/workout_app/test/screens/run_screen_sandbox_test.dart @@ -94,5 +94,14 @@ void main() { expect(run.track.distanceM, closeTo(4000, 20)); expect(run.uploadState, RunUploadState.pending); expect(run.tcxFilename, endsWith('_Running.tcx')); + // The kilometre chimes play after the platform's vibrator probe answers, so + // the last ones can land after the final pump above. audioplayers starts a + // frame callback per play and cancels only the newest on completion; let + // them land and run, or the framework reports them as still running. + await tester.runAsync( + () => Future.delayed(const Duration(milliseconds: 300)), + ); + await tester.pump(); + await tester.pump(); }); }