Allow the runs burst bench for executing rows' clock-driven durations
This commit is contained in:
@@ -211,9 +211,11 @@ void main() {
|
||||
controller.addListener(() => notifications++);
|
||||
await tester.pumpWidget(shell(AppDestination.runs));
|
||||
await tester.pump();
|
||||
final rows = find.byType(RunListRow).evaluate().length;
|
||||
rebuilds
|
||||
..reset()
|
||||
..install();
|
||||
final wall = Stopwatch()..start();
|
||||
// Frames arrive between frames on a real socket: pump after each.
|
||||
for (var i = 0; i < 50; i++) {
|
||||
frame(i);
|
||||
@@ -221,6 +223,7 @@ void main() {
|
||||
}
|
||||
await tester.pump();
|
||||
rebuilds.uninstall();
|
||||
final seconds = wall.elapsed.inSeconds;
|
||||
// ignore: avoid_print
|
||||
print(
|
||||
'BENCH visibleBurst50 controllerNotifications=$notifications '
|
||||
@@ -238,8 +241,13 @@ void main() {
|
||||
// Only the ten frames that advance a step change anything visible.
|
||||
expect(notifications, lessThanOrEqualTo(10));
|
||||
// Each notification rebuilds the one row whose run changed, not every
|
||||
// built row (16 rows rebuilt per notification before memoized rows).
|
||||
expect(rebuilds.of(RunListRow), lessThanOrEqualTo(notifications));
|
||||
// built row (16 rows rebuilt per notification before memoized rows). An
|
||||
// executing row also rebuilds when its wall-clock duration text moves to
|
||||
// the next second, at most once per second the burst took.
|
||||
expect(
|
||||
rebuilds.of(RunListRow),
|
||||
lessThanOrEqualTo(notifications + rows * (seconds + 1)),
|
||||
);
|
||||
await tester.pumpWidget(const SizedBox());
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user