Just insert it before bad tester.pumpAndSettle() and analyze output.
await TestAsyncUtils.guard<int>(() async {
final DateTime endTime =
tester.binding.clock.fromNowBy(Duration(seconds: 30));
int count = 0;
do {
if (tester.binding.clock.now().isAfter(endTime)) {
break;
}
await tester.binding.pump(
Duration(milliseconds: 100), EnginePhase.sendSemanticsUpdate);
count += 1;
} while (tester.binding.hasScheduledFrame);
return count;
});
debugProfilePaintsEnabled = true;
debugPrintBeginFrameBanner = true;
debugPrintEndFrameBanner = true;
debugProfileLayoutsEnabled = true;
debugPrintLayouts = true;
debugPrintMarkNeedsLayoutStacks = true;
debugPrintRebuildDirtyWidgets = true;
debugDumpApp();
await TestAsyncUtils.guard<int>(() async {
final DateTime endTime =
tester.binding.clock.fromNowBy(Duration(seconds: 1));
int count = 0;
do {
if (tester.binding.clock.now().isAfter(endTime)) {
break;
}
await tester.binding.pump(
Duration(milliseconds: 100), EnginePhase.sendSemanticsUpdate);
count += 1;
} while (tester.binding.hasScheduledFrame);
return count;
});