From afb613774dc4c53b4a2eff45bc22f9b3575421ca Mon Sep 17 00:00:00 2001 From: Ian Hickson Date: Sun, 12 Aug 2018 00:14:33 -0700 Subject: [PATCH] Reduce noise on complex_layout_scroll_perf__timeline_summary (#20400) See https://github.com/flutter/flutter/issues/19434 --- .../complex_layout/test_driver/scroll_perf_test.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dev/benchmarks/complex_layout/test_driver/scroll_perf_test.dart b/dev/benchmarks/complex_layout/test_driver/scroll_perf_test.dart index 1f47c7f079d..9c66e6d368f 100644 --- a/dev/benchmarks/complex_layout/test_driver/scroll_perf_test.dart +++ b/dev/benchmarks/complex_layout/test_driver/scroll_perf_test.dart @@ -20,19 +20,24 @@ void main() { }); Future testScrollPerf(String listKey, String summaryName) async { + // The slight initial delay avoids starting the timing during a + // period of increased load on the device. Without this delay, the + // benchmark has greater noise. + // See: https://github.com/flutter/flutter/issues/19434 + await new Future.delayed(const Duration(milliseconds: 250)); final Timeline timeline = await driver.traceAction(() async { // Find the scrollable stock list final SerializableFinder list = find.byValueKey(listKey); expect(list, isNotNull); // Scroll down - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 5; i += 1) { await driver.scroll(list, 0.0, -300.0, const Duration(milliseconds: 300)); await new Future.delayed(const Duration(milliseconds: 500)); } // Scroll up - for (int i = 0; i < 5; i++) { + for (int i = 0; i < 5; i += 1) { await driver.scroll(list, 0.0, 300.0, const Duration(milliseconds: 300)); await new Future.delayed(const Duration(milliseconds: 500)); }