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 c40876a6f7d..9dd60ce3d96 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,6 +7,7 @@ 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 0be01166667..6609d16760a 100644 --- a/dev/benchmarks/macrobenchmarks/test/cull_opacity_perf_e2e.dart +++ b/dev/benchmarks/macrobenchmarks/test/cull_opacity_perf_e2e.dart @@ -15,5 +15,6 @@ 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 442c9ec56fe..c5991e22230 100644 --- a/dev/benchmarks/macrobenchmarks/test/multi_widget_construction_perf_e2e.dart +++ b/dev/benchmarks/macrobenchmarks/test/multi_widget_construction_perf_e2e.dart @@ -12,5 +12,6 @@ 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 45190fee6e8..557a029b032 100644 --- a/dev/benchmarks/macrobenchmarks/test/util.dart +++ b/dev/benchmarks/macrobenchmarks/test/util.dart @@ -15,6 +15,7 @@ void macroPerfTestE2E( String routeName, { Duration pageDelay, Duration duration = const Duration(seconds: 3), + Duration timeout = const Duration(seconds: 30), ControlCallback body, ControlCallback setup, }) { @@ -62,5 +63,5 @@ void macroPerfTestE2E( } await durationFuture; }); - }, semanticsEnabled: false); + }, semanticsEnabled: false, timeout: Timeout(timeout)); } 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 40c8e810729..eb7a8c6528b 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/cull_opacity_perf_test.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/cull_opacity_perf_test.dart @@ -12,5 +12,6 @@ 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 b6b9b8bc938..d931eff9c73 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/e2e_test.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/e2e_test.dart @@ -5,6 +5,7 @@ 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 77aa56aeb7b..53a2a0d61a8 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/frame_policy_test.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/frame_policy_test.dart @@ -7,6 +7,7 @@ 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 b233b17286e..7b4b00de3ff 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,5 +12,6 @@ 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 31445b2df92..0affa49ac8e 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf_test.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/picture_cache_perf_test.dart @@ -11,6 +11,7 @@ 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 bda4d3f66b9..6344b5c6daf 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 bd14c57e9d5..55a18df3c9d 100644 --- a/dev/benchmarks/macrobenchmarks/test_driver/util.dart +++ b/dev/benchmarks/macrobenchmarks/test_driver/util.dart @@ -6,6 +6,8 @@ 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 { @@ -32,13 +34,14 @@ Future runDriverTestForRoute(String routeName, DriverTestCallBack body) as } void macroPerfTest( - String testName, - String routeName, { - Duration pageDelay, - Duration duration = const Duration(seconds: 3), - Future Function(FlutterDriver driver) driverOps, - Future Function(FlutterDriver driver) setupOps, -}) { + 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, + }) { test(testName, () async { Timeline timeline; await runDriverTestForRoute(routeName, (FlutterDriver driver) async { @@ -64,5 +67,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 05a43315a6d..308ec4e656c 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,7 +36,8 @@ void main() { final SerializableFinder stockOption = find.byValueKey('AAPL_symbol_name'); - final String symbol = await driver.getText(stockOption); + final String symbol = await driver.getText(stockOption, + timeout: const Duration(milliseconds: 500)); 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 1887732ad54..58932866b2f 100644 --- a/dev/integration_tests/android_views/test_driver/main_test.dart +++ b/dev/integration_tests/android_views/test_driver/main_test.dart @@ -59,6 +59,7 @@ 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 24a48f945a9..dcba3271610 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 cb3a81730a8..0225af57236 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,6 +48,7 @@ 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 6ea85114be3..e4936e83095 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,6 +5,7 @@ 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 41710208d19..e6b7d7db99b 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,6 +130,7 @@ 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) { @@ -217,6 +218,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 7aee1ed1ba0..dfdb903f5f1 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')); + await driver.waitForAbsent(find.byType('PerformanceOverlay'), timeout: Duration.zero); }); } 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 0105ae9d487..c4890552dcd 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')); + await driver.waitFor(find.byType('PerformanceOverlay'), timeout: Duration.zero); }); } diff --git a/dev/integration_tests/ui/test_driver/empty_test.dart b/dev/integration_tests/ui/test_driver/empty_test.dart index 2afd05ddb3b..2daec600ff5 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 {}); + test('empty', () async {}, timeout: const Timeout(Duration(minutes: 1))); }); } diff --git a/dev/integration_tests/ui/test_driver/screenshot_test.dart b/dev/integration_tests/ui/test_driver/screenshot_test.dart index 2073b70eac9..34618c18c48 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 e01a229d27d..866785e87c7 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: 20), + Duration timeout = const Duration(minutes: 1), ResponseDataCallback? responseDataCallback = writeResponseData, }) async { final FlutterDriver driver = await FlutterDriver.connect();