Unverified Commit b96c3c22 authored by Dan Field's avatar Dan Field Committed by GitHub

Remove per-test timeouts from integration tests (#85098)

parent 5a83c874
...@@ -7,7 +7,6 @@ import 'dart:async'; ...@@ -7,7 +7,6 @@ import 'dart:async';
import 'package:integration_test/integration_test_driver.dart' as driver; import 'package:integration_test/integration_test_driver.dart' as driver;
Future<void> main() => driver.integrationDriver( Future<void> main() => driver.integrationDriver(
timeout: const Duration(minutes: 5),
responseDataCallback: (Map<String, dynamic>? data) async { responseDataCallback: (Map<String, dynamic>? data) async {
await driver.writeResponseData( await driver.writeResponseData(
data, data,
......
...@@ -15,6 +15,5 @@ Future<void> main() async { ...@@ -15,6 +15,5 @@ Future<void> main() async {
kCullOpacityRouteName, kCullOpacityRouteName,
pageDelay: const Duration(seconds: 1), pageDelay: const Duration(seconds: 1),
duration: const Duration(seconds: 10), duration: const Duration(seconds: 10),
timeout: const Duration(seconds: 45),
); );
} }
...@@ -12,6 +12,5 @@ void main() { ...@@ -12,6 +12,5 @@ void main() {
kMultiWidgetConstructionRouteName, kMultiWidgetConstructionRouteName,
pageDelay: const Duration(seconds: 1), pageDelay: const Duration(seconds: 1),
duration: const Duration(seconds: 10), duration: const Duration(seconds: 10),
timeout: const Duration(seconds: 45),
); );
} }
...@@ -15,7 +15,6 @@ void macroPerfTestE2E( ...@@ -15,7 +15,6 @@ void macroPerfTestE2E(
String routeName, { String routeName, {
Duration pageDelay, Duration pageDelay,
Duration duration = const Duration(seconds: 3), Duration duration = const Duration(seconds: 3),
Duration timeout = const Duration(seconds: 30),
ControlCallback body, ControlCallback body,
ControlCallback setup, ControlCallback setup,
}) { }) {
...@@ -63,5 +62,5 @@ void macroPerfTestE2E( ...@@ -63,5 +62,5 @@ void macroPerfTestE2E(
} }
await durationFuture; await durationFuture;
}); });
}, semanticsEnabled: false, timeout: Timeout(timeout)); }, semanticsEnabled: false);
} }
...@@ -12,6 +12,5 @@ void main() { ...@@ -12,6 +12,5 @@ void main() {
kCullOpacityRouteName, kCullOpacityRouteName,
pageDelay: const Duration(seconds: 1), pageDelay: const Duration(seconds: 1),
duration: const Duration(seconds: 10), duration: const Duration(seconds: 10),
timeout: const Duration(minutes: 2),
); );
} }
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
import 'package:integration_test/integration_test_driver.dart' as driver; import 'package:integration_test/integration_test_driver.dart' as driver;
Future<void> main() => driver.integrationDriver( Future<void> main() => driver.integrationDriver(
timeout: const Duration(minutes: 5),
responseDataCallback: (Map<String, dynamic> data) async { responseDataCallback: (Map<String, dynamic> data) async {
await driver.writeResponseData( await driver.writeResponseData(
data['performance'] as Map<String, dynamic>, data['performance'] as Map<String, dynamic>,
......
...@@ -7,7 +7,6 @@ import 'dart:io'; ...@@ -7,7 +7,6 @@ import 'dart:io';
import 'package:integration_test/integration_test_driver.dart' as driver; import 'package:integration_test/integration_test_driver.dart' as driver;
Future<void> main() => driver.integrationDriver( Future<void> main() => driver.integrationDriver(
timeout: const Duration(minutes: 1),
responseDataCallback: (Map<String, dynamic> data) async { responseDataCallback: (Map<String, dynamic> data) async {
final Map<String, dynamic> benchmarkLiveResult = final Map<String, dynamic> benchmarkLiveResult =
data['benchmarkLive'] as Map<String,dynamic>; data['benchmarkLive'] as Map<String,dynamic>;
......
...@@ -12,6 +12,5 @@ void main() { ...@@ -12,6 +12,5 @@ void main() {
kMultiWidgetConstructionRouteName, kMultiWidgetConstructionRouteName,
pageDelay: const Duration(seconds: 1), pageDelay: const Duration(seconds: 1),
duration: const Duration(seconds: 10), duration: const Duration(seconds: 10),
timeout: const Duration(seconds: 45),
); );
} }
...@@ -11,7 +11,6 @@ void main() { ...@@ -11,7 +11,6 @@ void main() {
macroPerfTest( macroPerfTest(
'picture_cache_perf', 'picture_cache_perf',
kPictureCacheRouteName, kPictureCacheRouteName,
timeout: const Duration(seconds: 60),
pageDelay: const Duration(seconds: 1), pageDelay: const Duration(seconds: 1),
driverOps: (FlutterDriver driver) async { driverOps: (FlutterDriver driver) async {
final SerializableFinder tabBarView = find.byValueKey('tabbar_view'); final SerializableFinder tabBarView = find.byValueKey('tabbar_view');
......
...@@ -30,7 +30,7 @@ void main() { ...@@ -30,7 +30,7 @@ void main() {
await file.writeAsString(_encodeJson(<String, dynamic>{ await file.writeAsString(_encodeJson(<String, dynamic>{
'stack_size': stackSizeInBytes, 'stack_size': stackSizeInBytes,
})); }));
}, timeout: const Timeout(kTimeout)); });
} }
String _encodeJson(Map<String, dynamic> jsonObject) { String _encodeJson(Map<String, dynamic> jsonObject) {
......
...@@ -6,8 +6,6 @@ import 'package:flutter_driver/flutter_driver.dart'; ...@@ -6,8 +6,6 @@ import 'package:flutter_driver/flutter_driver.dart';
import 'package:macrobenchmarks/common.dart'; import 'package:macrobenchmarks/common.dart';
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf; import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
const Duration kTimeout = Duration(seconds: 30);
typedef DriverTestCallBack = Future<void> Function(FlutterDriver driver); typedef DriverTestCallBack = Future<void> Function(FlutterDriver driver);
Future<void> runDriverTestForRoute(String routeName, DriverTestCallBack body) async { Future<void> runDriverTestForRoute(String routeName, DriverTestCallBack body) async {
...@@ -34,14 +32,13 @@ Future<void> runDriverTestForRoute(String routeName, DriverTestCallBack body) as ...@@ -34,14 +32,13 @@ Future<void> runDriverTestForRoute(String routeName, DriverTestCallBack body) as
} }
void macroPerfTest( void macroPerfTest(
String testName, String testName,
String routeName, String routeName, {
{ Duration pageDelay, Duration pageDelay,
Duration duration = const Duration(seconds: 3), Duration duration = const Duration(seconds: 3),
Duration timeout = kTimeout, Future<void> Function(FlutterDriver driver) driverOps,
Future<void> Function(FlutterDriver driver) driverOps, Future<void> Function(FlutterDriver driver) setupOps,
Future<void> Function(FlutterDriver driver) setupOps, }) {
}) {
test(testName, () async { test(testName, () async {
Timeline timeline; Timeline timeline;
await runDriverTestForRoute(routeName, (FlutterDriver driver) async { await runDriverTestForRoute(routeName, (FlutterDriver driver) async {
...@@ -67,5 +64,5 @@ void macroPerfTest( ...@@ -67,5 +64,5 @@ void macroPerfTest(
final TimelineSummary summary = TimelineSummary.summarize(timeline); final TimelineSummary summary = TimelineSummary.summarize(timeline);
await summary.writeTimelineToFile(testName, pretty: true); await summary.writeTimelineToFile(testName, pretty: true);
}, timeout: Timeout(timeout)); });
} }
...@@ -36,8 +36,7 @@ void main() { ...@@ -36,8 +36,7 @@ void main() {
final SerializableFinder stockOption = final SerializableFinder stockOption =
find.byValueKey('AAPL_symbol_name'); 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'); expect(symbol, 'AAPL');
}, skip: 'Needs to be fixed on Fuchsia.'); }, skip: 'Needs to be fixed on Fuchsia.');
......
...@@ -59,7 +59,6 @@ Future<void> main() async { ...@@ -59,7 +59,6 @@ Future<void> main() async {
await driver.tap(tapWindow); await driver.tap(tapWindow);
final String windowClickCount = await driver.getText( final String windowClickCount = await driver.getText(
find.byValueKey('WindowClickCount'), find.byValueKey('WindowClickCount'),
timeout: const Duration(seconds: 5),
); );
expect(windowClickCount, 'Click count: 1'); expect(windowClickCount, 'Click count: 1');
}); });
......
...@@ -25,7 +25,7 @@ void main() { ...@@ -25,7 +25,7 @@ void main() {
if (status != 'complete') { if (status != 'complete') {
fail('Failed at step $step with status $status'); fail('Failed at step $step with status $status');
} }
}, timeout: const Timeout(Duration(minutes: 1))); });
tearDownAll(() async { tearDownAll(() async {
driver.close(); driver.close();
......
...@@ -48,7 +48,6 @@ void main([List<String> args = const <String>[]]) { ...@@ -48,7 +48,6 @@ void main([List<String> args = const <String>[]]) {
..removeAll(kProfiledDemos); ..removeAll(kProfiledDemos);
await runDemos(unprofiledDemos.toList(), tester); await runDemos(unprofiledDemos.toList(), tester);
}, },
timeout: const Timeout(Duration(minutes: 5)),
semanticsEnabled: withSemantics, semanticsEnabled: withSemantics,
); );
}); });
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
import 'package:integration_test/integration_test_driver.dart' as driver; import 'package:integration_test/integration_test_driver.dart' as driver;
Future<void> main() => driver.integrationDriver( Future<void> main() => driver.integrationDriver(
timeout: const Duration(minutes: 5),
responseDataCallback: (Map<String, dynamic>? data) async { responseDataCallback: (Map<String, dynamic>? data) async {
await driver.writeResponseData( await driver.writeResponseData(
data!['performance'] as Map<String, dynamic>, data!['performance'] as Map<String, dynamic>,
......
...@@ -130,7 +130,6 @@ Future<void> runDemos(List<String> demos, FlutterDriver driver) async { ...@@ -130,7 +130,6 @@ Future<void> runDemos(List<String> demos, FlutterDriver driver) async {
await driver.scrollUntilVisible(demoList, demoItem, await driver.scrollUntilVisible(demoList, demoItem,
dyScroll: -48.0, dyScroll: -48.0,
alignment: 0.5, alignment: 0.5,
timeout: const Duration(seconds: 30),
); );
for (int i = 0; i < 2; i += 1) { for (int i = 0; i < 2; i += 1) {
...@@ -218,6 +217,6 @@ void main([List<String> args = const <String>[]]) { ...@@ -218,6 +217,6 @@ void main([List<String> args = const <String>[]]) {
await runDemos(unprofiledDemos.toList(), driver); await runDemos(unprofiledDemos.toList(), driver);
} }
}, timeout: const Timeout(Duration(minutes: 5))); });
}); });
} }
...@@ -18,6 +18,6 @@ void main() { ...@@ -18,6 +18,6 @@ void main() {
test('check that we are in normal mode', () async { test('check that we are in normal mode', () async {
expect(await driver.requestData('status'), 'log: paint'); expect(await driver.requestData('status'), 'log: paint');
await driver.waitForAbsent(find.byType('PerformanceOverlay'), timeout: Duration.zero); await driver.waitForAbsent(find.byType('PerformanceOverlay'));
}); });
} }
...@@ -18,6 +18,6 @@ void main() { ...@@ -18,6 +18,6 @@ void main() {
test('check that we are showing the performance overlay', () async { test('check that we are showing the performance overlay', () async {
await driver.requestData('status'); // force a reassemble await driver.requestData('status'); // force a reassemble
await driver.waitFor(find.byType('PerformanceOverlay'), timeout: Duration.zero); await driver.waitFor(find.byType('PerformanceOverlay'));
}); });
} }
...@@ -18,6 +18,6 @@ void main() { ...@@ -18,6 +18,6 @@ void main() {
await driver.close(); await driver.close();
}); });
test('empty', () async {}, timeout: const Timeout(Duration(minutes: 1))); test('empty', () async {});
}); });
} }
...@@ -48,6 +48,6 @@ void main() { ...@@ -48,6 +48,6 @@ void main() {
imageBefore = imageAfter; imageBefore = imageAfter;
} }
}, timeout: const Timeout(Duration(minutes: 2))); });
}); });
} }
...@@ -64,7 +64,7 @@ Future<void> writeResponseData( ...@@ -64,7 +64,7 @@ Future<void> writeResponseData(
/// ///
/// ``` /// ```
Future<void> integrationDriver({ Future<void> integrationDriver({
Duration timeout = const Duration(minutes: 1), Duration timeout = const Duration(minutes: 20),
ResponseDataCallback? responseDataCallback = writeResponseData, ResponseDataCallback? responseDataCallback = writeResponseData,
}) async { }) async {
final FlutterDriver driver = await FlutterDriver.connect(); final FlutterDriver driver = await FlutterDriver.connect();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment