From b96c3c22ce350cd1999066601804c50a36e97ce6 Mon Sep 17 00:00:00 2001 From: Dan Field Date: Wed, 23 Jun 2021 07:17:28 -0700 Subject: [PATCH] Remove per-test timeouts from integration tests (#85098) --- .../measure_scroll_smoothness_test.dart | 1 - .../test/cull_opacity_perf_e2e.dart | 1 - .../multi_widget_construction_perf_e2e.dart | 1 - dev/benchmarks/macrobenchmarks/test/util.dart | 3 +-- .../test_driver/cull_opacity_perf_test.dart | 1 - .../macrobenchmarks/test_driver/e2e_test.dart | 1 - .../test_driver/frame_policy_test.dart | 1 - .../multi_widget_construction_perf_test.dart | 1 - .../test_driver/picture_cache_perf_test.dart | 1 - .../test_driver/stack_size_perf_test.dart | 2 +- .../macrobenchmarks/test_driver/util.dart | 19 ++++++++----------- .../stocks/test_driver/stock_view_test.dart | 3 +-- .../android_views/test_driver/main_test.dart | 1 - .../channels/test_driver/main_test.dart | 2 +- .../test_driver/transitions_perf_e2e.dart | 1 - .../transitions_perf_e2e_test.dart | 1 - .../test_driver/transitions_perf_test.dart | 3 +-- .../ui/test_driver/commands_none_test.dart | 2 +- .../commands_performance_overlay_test.dart | 2 +- .../ui/test_driver/empty_test.dart | 2 +- .../ui/test_driver/screenshot_test.dart | 2 +- .../lib/integration_test_driver.dart | 2 +- 22 files changed, 18 insertions(+), 35 deletions(-) diff --git a/dev/benchmarks/complex_layout/test_driver/measure_scroll_smoothness_test.dart b/dev/benchmarks/complex_layout/test_driver/measure_scroll_smoothness_test.dart index 9dd60ce3d9..c40876a6f7 100644 --- a/dev/benchmarks/complex_layout/test_driver/measure_scroll_smoothness_test.dart +++ b/dev/benchmarks/complex_layout/test_driver/measure_scroll_smoothness_test.dart @@ -7,7 +7,6 @@ import 'dart:async'; import 'package:integration_test/integration_test_driver.dart' as driver; Future main() => driver.integrationDriver( - timeout: const Duration(minutes: 5), responseDataCallback: (Map? data) async { await driver.writeResponseData( data, diff --git a/dev/benchmarks/macrobenchmarks/test/cull_opacity_perf_e2e.dart b/dev/benchmarks/macrobenchmarks/test/cull_opacity_perf_e2e.dart index 6609d16760..0be0116666 100644 --- a/dev/benchmarks/macrobenchmarks/test/cull_opacity_perf_e2e.dart +++ b/dev/benchmarks/macrobenchmarks/test/cull_opacity_perf_e2e.dart @@ -15,6 +15,5 @@ Future main() async { kCullOpacityRouteName, pageDelay: const Duration(seconds: 1), duration: const Duration(seconds: 10), - timeout: const Duration(seconds: 45), ); } diff --git a/dev/benchmarks/macrobenchmarks/test/multi_widget_construction_perf_e2e.dart b/dev/benchmarks/macrobenchmarks/test/multi_widget_construction_perf_e2e.dart index c5991e2223..442c9ec56f 100644 --- a/dev/benchmarks/macrobenchmarks/test/multi_widget_construction_perf_e2e.dart +++ b/dev/benchmarks/macrobenchmarks/test/multi_widget_construction_perf_e2e.dart @@ -12,6 +12,5 @@ void main() { kMultiWidgetConstructionRouteName, pageDelay: const Duration(seconds: 1), duration: const Duration(seconds: 10), - timeout: const Duration(seconds: 45), ); } diff --git a/dev/benchmarks/macrobenchmarks/test/util.dart b/dev/benchmarks/macrobenchmarks/test/util.dart index 557a029b03..45190fee6e 100644 --- a/dev/benchmarks/macrobenchmarks/test/util.dart +++ b/dev/benchmarks/macrobenchmarks/test/util.dart @@ -15,7 +15,6 @@ void macroPerfTestE2E( String routeName, { Duration pageDelay, Duration duration = const Duration(seconds: 3), - Duration timeout = const Duration(seconds: 30), ControlCallback body, ControlCallback setup, }) { @@ -63,5 +62,5 @@ void macroPerfTestE2E( } await durationFuture; }); - }, semanticsEnabled: false, timeout: Timeout(timeout)); + }, semanticsEnabled: false); } diff --git a/dev/benchmarks/macrobenchmarks/test_driver/cull_opacity_perf_test.dart b/dev/benchmarks/macrobenchmarks/test_driver/cull_opacity_perf_test.dart index eb7a8c6528..40c8e81072 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/cull_opacity_perf_test.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/cull_opacity_perf_test.dart @@ -12,6 +12,5 @@ void main() { kCullOpacityRouteName, pageDelay: const Duration(seconds: 1), duration: const Duration(seconds: 10), - timeout: const Duration(minutes: 2), ); } diff --git a/dev/benchmarks/macrobenchmarks/test_driver/e2e_test.dart b/dev/benchmarks/macrobenchmarks/test_driver/e2e_test.dart index d931eff9c7..b6b9b8bc93 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/e2e_test.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/e2e_test.dart @@ -5,7 +5,6 @@ import 'package:integration_test/integration_test_driver.dart' as driver; Future main() => driver.integrationDriver( - timeout: const Duration(minutes: 5), responseDataCallback: (Map data) async { await driver.writeResponseData( data['performance'] as Map, diff --git a/dev/benchmarks/macrobenchmarks/test_driver/frame_policy_test.dart b/dev/benchmarks/macrobenchmarks/test_driver/frame_policy_test.dart index 53a2a0d61a..77aa56aeb7 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/frame_policy_test.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/frame_policy_test.dart @@ -7,7 +7,6 @@ import 'dart:io'; import 'package:integration_test/integration_test_driver.dart' as driver; Future main() => driver.integrationDriver( - timeout: const Duration(minutes: 1), responseDataCallback: (Map data) async { final Map benchmarkLiveResult = data['benchmarkLive'] as Map; diff --git a/dev/benchmarks/macrobenchmarks/test_driver/multi_widget_construction_perf_test.dart b/dev/benchmarks/macrobenchmarks/test_driver/multi_widget_construction_perf_test.dart index 7b4b00de3f..b233b17286 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/multi_widget_construction_perf_test.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/multi_widget_construction_perf_test.dart @@ -12,6 +12,5 @@ void main() { kMultiWidgetConstructionRouteName, pageDelay: const Duration(seconds: 1), duration: const Duration(seconds: 10), - timeout: const Duration(seconds: 45), ); } diff --git a/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf_test.dart b/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf_test.dart index 0affa49ac8..31445b2df9 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf_test.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf_test.dart @@ -11,7 +11,6 @@ void main() { macroPerfTest( 'picture_cache_perf', kPictureCacheRouteName, - timeout: const Duration(seconds: 60), pageDelay: const Duration(seconds: 1), driverOps: (FlutterDriver driver) async { final SerializableFinder tabBarView = find.byValueKey('tabbar_view'); diff --git a/dev/benchmarks/macrobenchmarks/test_driver/stack_size_perf_test.dart b/dev/benchmarks/macrobenchmarks/test_driver/stack_size_perf_test.dart index 6344b5c6da..bda4d3f66b 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/stack_size_perf_test.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/stack_size_perf_test.dart @@ -30,7 +30,7 @@ void main() { await file.writeAsString(_encodeJson({ 'stack_size': stackSizeInBytes, })); - }, timeout: const Timeout(kTimeout)); + }); } String _encodeJson(Map jsonObject) { diff --git a/dev/benchmarks/macrobenchmarks/test_driver/util.dart b/dev/benchmarks/macrobenchmarks/test_driver/util.dart index 55a18df3c9..bd14c57e9d 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/util.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/util.dart @@ -6,8 +6,6 @@ import 'package:flutter_driver/flutter_driver.dart'; import 'package:macrobenchmarks/common.dart'; import 'package:test/test.dart' hide TypeMatcher, isInstanceOf; -const Duration kTimeout = Duration(seconds: 30); - typedef DriverTestCallBack = Future Function(FlutterDriver driver); Future runDriverTestForRoute(String routeName, DriverTestCallBack body) async { @@ -34,14 +32,13 @@ Future runDriverTestForRoute(String routeName, DriverTestCallBack body) as } void macroPerfTest( - String testName, - String routeName, - { Duration pageDelay, - Duration duration = const Duration(seconds: 3), - Duration timeout = kTimeout, - Future Function(FlutterDriver driver) driverOps, - Future Function(FlutterDriver driver) setupOps, - }) { + String testName, + String routeName, { + Duration pageDelay, + Duration duration = const Duration(seconds: 3), + Future Function(FlutterDriver driver) driverOps, + Future Function(FlutterDriver driver) setupOps, +}) { test(testName, () async { Timeline timeline; await runDriverTestForRoute(routeName, (FlutterDriver driver) async { @@ -67,5 +64,5 @@ void macroPerfTest( final TimelineSummary summary = TimelineSummary.summarize(timeline); await summary.writeTimelineToFile(testName, pretty: true); - }, timeout: Timeout(timeout)); + }); } diff --git a/dev/benchmarks/test_apps/stocks/test_driver/stock_view_test.dart b/dev/benchmarks/test_apps/stocks/test_driver/stock_view_test.dart index 308ec4e656..05a43315a6 100644 --- a/dev/benchmarks/test_apps/stocks/test_driver/stock_view_test.dart +++ b/dev/benchmarks/test_apps/stocks/test_driver/stock_view_test.dart @@ -36,8 +36,7 @@ void main() { final SerializableFinder stockOption = find.byValueKey('AAPL_symbol_name'); - final String symbol = await driver.getText(stockOption, - timeout: const Duration(milliseconds: 500)); + final String symbol = await driver.getText(stockOption); expect(symbol, 'AAPL'); }, skip: 'Needs to be fixed on Fuchsia.'); diff --git a/dev/integration_tests/android_views/test_driver/main_test.dart b/dev/integration_tests/android_views/test_driver/main_test.dart index 58932866b2..1887732ad5 100644 --- a/dev/integration_tests/android_views/test_driver/main_test.dart +++ b/dev/integration_tests/android_views/test_driver/main_test.dart @@ -59,7 +59,6 @@ Future main() async { await driver.tap(tapWindow); final String windowClickCount = await driver.getText( find.byValueKey('WindowClickCount'), - timeout: const Duration(seconds: 5), ); expect(windowClickCount, 'Click count: 1'); }); diff --git a/dev/integration_tests/channels/test_driver/main_test.dart b/dev/integration_tests/channels/test_driver/main_test.dart index dcba327161..24a48f945a 100644 --- a/dev/integration_tests/channels/test_driver/main_test.dart +++ b/dev/integration_tests/channels/test_driver/main_test.dart @@ -25,7 +25,7 @@ void main() { if (status != 'complete') { fail('Failed at step $step with status $status'); } - }, timeout: const Timeout(Duration(minutes: 1))); + }); tearDownAll(() async { driver.close(); diff --git a/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e.dart b/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e.dart index 0225af5723..cb3a81730a 100644 --- a/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e.dart +++ b/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e.dart @@ -48,7 +48,6 @@ void main([List args = const []]) { ..removeAll(kProfiledDemos); await runDemos(unprofiledDemos.toList(), tester); }, - timeout: const Timeout(Duration(minutes: 5)), semanticsEnabled: withSemantics, ); }); diff --git a/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e_test.dart b/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e_test.dart index e4936e8309..6ea85114be 100644 --- a/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e_test.dart +++ b/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_e2e_test.dart @@ -5,7 +5,6 @@ import 'package:integration_test/integration_test_driver.dart' as driver; Future main() => driver.integrationDriver( - timeout: const Duration(minutes: 5), responseDataCallback: (Map? data) async { await driver.writeResponseData( data!['performance'] as Map, diff --git a/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_test.dart b/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_test.dart index e6b7d7db99..41710208d1 100644 --- a/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_test.dart +++ b/dev/integration_tests/flutter_gallery/test_driver/transitions_perf_test.dart @@ -130,7 +130,6 @@ Future runDemos(List demos, FlutterDriver driver) async { await driver.scrollUntilVisible(demoList, demoItem, dyScroll: -48.0, alignment: 0.5, - timeout: const Duration(seconds: 30), ); for (int i = 0; i < 2; i += 1) { @@ -218,6 +217,6 @@ void main([List args = const []]) { await runDemos(unprofiledDemos.toList(), driver); } - }, timeout: const Timeout(Duration(minutes: 5))); + }); }); } diff --git a/dev/integration_tests/ui/test_driver/commands_none_test.dart b/dev/integration_tests/ui/test_driver/commands_none_test.dart index dfdb903f5f..7aee1ed1ba 100644 --- a/dev/integration_tests/ui/test_driver/commands_none_test.dart +++ b/dev/integration_tests/ui/test_driver/commands_none_test.dart @@ -18,6 +18,6 @@ void main() { test('check that we are in normal mode', () async { expect(await driver.requestData('status'), 'log: paint'); - await driver.waitForAbsent(find.byType('PerformanceOverlay'), timeout: Duration.zero); + await driver.waitForAbsent(find.byType('PerformanceOverlay')); }); } diff --git a/dev/integration_tests/ui/test_driver/commands_performance_overlay_test.dart b/dev/integration_tests/ui/test_driver/commands_performance_overlay_test.dart index c4890552dc..0105ae9d48 100644 --- a/dev/integration_tests/ui/test_driver/commands_performance_overlay_test.dart +++ b/dev/integration_tests/ui/test_driver/commands_performance_overlay_test.dart @@ -18,6 +18,6 @@ void main() { test('check that we are showing the performance overlay', () async { await driver.requestData('status'); // force a reassemble - await driver.waitFor(find.byType('PerformanceOverlay'), timeout: Duration.zero); + await driver.waitFor(find.byType('PerformanceOverlay')); }); } diff --git a/dev/integration_tests/ui/test_driver/empty_test.dart b/dev/integration_tests/ui/test_driver/empty_test.dart index 2daec600ff..2afd05ddb3 100644 --- a/dev/integration_tests/ui/test_driver/empty_test.dart +++ b/dev/integration_tests/ui/test_driver/empty_test.dart @@ -18,6 +18,6 @@ void main() { await driver.close(); }); - test('empty', () async {}, timeout: const Timeout(Duration(minutes: 1))); + test('empty', () async {}); }); } diff --git a/dev/integration_tests/ui/test_driver/screenshot_test.dart b/dev/integration_tests/ui/test_driver/screenshot_test.dart index 34618c18c4..2073b70eac 100644 --- a/dev/integration_tests/ui/test_driver/screenshot_test.dart +++ b/dev/integration_tests/ui/test_driver/screenshot_test.dart @@ -48,6 +48,6 @@ void main() { imageBefore = imageAfter; } - }, timeout: const Timeout(Duration(minutes: 2))); + }); }); } diff --git a/packages/integration_test/lib/integration_test_driver.dart b/packages/integration_test/lib/integration_test_driver.dart index 866785e87c..e01a229d27 100644 --- a/packages/integration_test/lib/integration_test_driver.dart +++ b/packages/integration_test/lib/integration_test_driver.dart @@ -64,7 +64,7 @@ Future writeResponseData( /// /// ``` Future integrationDriver({ - Duration timeout = const Duration(minutes: 1), + Duration timeout = const Duration(minutes: 20), ResponseDataCallback? responseDataCallback = writeResponseData, }) async { final FlutterDriver driver = await FlutterDriver.connect();