From 0fbfd14888d63e5bb076c25171f07154819fb9d8 Mon Sep 17 00:00:00 2001 From: Elliott Brooks <21270878+elliette@users.noreply.github.com> Date: Fri, 6 Mar 2026 16:00:07 -0800 Subject: [PATCH 1/2] Fix first benchmark failure --- packages/devtools_test/lib/src/helpers/actions.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/devtools_test/lib/src/helpers/actions.dart b/packages/devtools_test/lib/src/helpers/actions.dart index 4465cc6b7f0..b04a92a9e21 100644 --- a/packages/devtools_test/lib/src/helpers/actions.dart +++ b/packages/devtools_test/lib/src/helpers/actions.dart @@ -185,5 +185,5 @@ Future scrollToEnd(WidgetController controller) async { duration: const Duration(milliseconds: 500), curve: Curves.easeInOutCubic, ); - await controller.pump(shortPumpDuration); + await controller.pumpAndSettle(shortPumpDuration); } From 3aa30988c3604028476afe181724ac0d16a482c8 Mon Sep 17 00:00:00 2001 From: Elliott Brooks <21270878+elliette@users.noreply.github.com> Date: Tue, 10 Mar 2026 10:57:56 -0700 Subject: [PATCH 2/2] Try to fix other failure --- .../lib/src/helpers/actions.dart | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/packages/devtools_test/lib/src/helpers/actions.dart b/packages/devtools_test/lib/src/helpers/actions.dart index b04a92a9e21..f772168a9d4 100644 --- a/packages/devtools_test/lib/src/helpers/actions.dart +++ b/packages/devtools_test/lib/src/helpers/actions.dart @@ -110,10 +110,26 @@ Future switchToScreen( ); _maybeExpect(tabFinder, findsOneWidget, shouldExpect: runWithExpectations); - await controller.tap(tabFinder, warnIfMissed: warnIfTapMissed); - // We use pump here instead of pumpAndSettle because pumpAndSettle will - // never complete if there is an animation (e.g. a progress indicator). - await controller.pump(safePumpDuration); + await retryAsync( + () async { + try { + await controller.tap(tabFinder, warnIfMissed: warnIfTapMissed); + // We use pump here instead of pumpAndSettle because pumpAndSettle will + // never complete if there is an animation (e.g. a progress indicator). + await controller.pump(safePumpDuration); + return true; + } catch (e) { + logStatus('Attempt to switch to $screenId failed with error: $e'); + return false; + } + }, + condition: (success) => success, + onRetry: () async { + logStatus('Retrying switch to $screenId...'); + // Try pumping again to give UI time to settle. + await controller.pump(safePumpDuration); + }, + ); } /// Finds the tab with [icon] either in the top-level DevTools tab bar or in the @@ -174,7 +190,10 @@ Future loadSampleData( /// 2) access the [Scrollbar] widget's [ScrollController]. /// 3) scroll the scrollable attached to the [ScrollController] to the end of /// the [ScrollController]'s scroll extent. -Future scrollToEnd(WidgetController controller) async { +Future scrollToEnd( + WidgetController controller, { + bool waitForSettle = true, +}) async { final scrollbarFinder = find.descendant( of: find.byType(T), matching: find.byType(Scrollbar), @@ -185,5 +204,7 @@ Future scrollToEnd(WidgetController controller) async { duration: const Duration(milliseconds: 500), curve: Curves.easeInOutCubic, ); - await controller.pumpAndSettle(shortPumpDuration); + await (waitForSettle + ? controller.pumpAndSettle(shortPumpDuration) + : controller.pump(shortPumpDuration)); }