Remove per-test timeouts from integration tests (#85098)
This commit is contained in:
parent
5a83c87473
commit
b96c3c22ce
@ -7,7 +7,6 @@ import 'dart:async';
|
||||
import 'package:integration_test/integration_test_driver.dart' as driver;
|
||||
|
||||
Future<void> main() => driver.integrationDriver(
|
||||
timeout: const Duration(minutes: 5),
|
||||
responseDataCallback: (Map<String, dynamic>? data) async {
|
||||
await driver.writeResponseData(
|
||||
data,
|
||||
|
@ -15,6 +15,5 @@ Future<void> main() async {
|
||||
kCullOpacityRouteName,
|
||||
pageDelay: const Duration(seconds: 1),
|
||||
duration: const Duration(seconds: 10),
|
||||
timeout: const Duration(seconds: 45),
|
||||
);
|
||||
}
|
||||
|
@ -12,6 +12,5 @@ void main() {
|
||||
kMultiWidgetConstructionRouteName,
|
||||
pageDelay: const Duration(seconds: 1),
|
||||
duration: const Duration(seconds: 10),
|
||||
timeout: const Duration(seconds: 45),
|
||||
);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -12,6 +12,5 @@ void main() {
|
||||
kCullOpacityRouteName,
|
||||
pageDelay: const Duration(seconds: 1),
|
||||
duration: const Duration(seconds: 10),
|
||||
timeout: const Duration(minutes: 2),
|
||||
);
|
||||
}
|
||||
|
@ -5,7 +5,6 @@
|
||||
import 'package:integration_test/integration_test_driver.dart' as driver;
|
||||
|
||||
Future<void> main() => driver.integrationDriver(
|
||||
timeout: const Duration(minutes: 5),
|
||||
responseDataCallback: (Map<String, dynamic> data) async {
|
||||
await driver.writeResponseData(
|
||||
data['performance'] as Map<String, dynamic>,
|
||||
|
@ -7,7 +7,6 @@ import 'dart:io';
|
||||
import 'package:integration_test/integration_test_driver.dart' as driver;
|
||||
|
||||
Future<void> main() => driver.integrationDriver(
|
||||
timeout: const Duration(minutes: 1),
|
||||
responseDataCallback: (Map<String, dynamic> data) async {
|
||||
final Map<String, dynamic> benchmarkLiveResult =
|
||||
data['benchmarkLive'] as Map<String,dynamic>;
|
||||
|
@ -12,6 +12,5 @@ void main() {
|
||||
kMultiWidgetConstructionRouteName,
|
||||
pageDelay: const Duration(seconds: 1),
|
||||
duration: const Duration(seconds: 10),
|
||||
timeout: const Duration(seconds: 45),
|
||||
);
|
||||
}
|
||||
|
@ -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');
|
||||
|
@ -30,7 +30,7 @@ void main() {
|
||||
await file.writeAsString(_encodeJson(<String, dynamic>{
|
||||
'stack_size': stackSizeInBytes,
|
||||
}));
|
||||
}, timeout: const Timeout(kTimeout));
|
||||
});
|
||||
}
|
||||
|
||||
String _encodeJson(Map<String, dynamic> jsonObject) {
|
||||
|
@ -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<void> Function(FlutterDriver driver);
|
||||
|
||||
Future<void> runDriverTestForRoute(String routeName, DriverTestCallBack body) async {
|
||||
@ -34,14 +32,13 @@ Future<void> runDriverTestForRoute(String routeName, DriverTestCallBack body) as
|
||||
}
|
||||
|
||||
void macroPerfTest(
|
||||
String testName,
|
||||
String routeName,
|
||||
{ Duration pageDelay,
|
||||
Duration duration = const Duration(seconds: 3),
|
||||
Duration timeout = kTimeout,
|
||||
Future<void> Function(FlutterDriver driver) driverOps,
|
||||
Future<void> Function(FlutterDriver driver) setupOps,
|
||||
}) {
|
||||
String testName,
|
||||
String routeName, {
|
||||
Duration pageDelay,
|
||||
Duration duration = const Duration(seconds: 3),
|
||||
Future<void> Function(FlutterDriver driver) driverOps,
|
||||
Future<void> 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));
|
||||
});
|
||||
}
|
||||
|
@ -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.');
|
||||
|
@ -59,7 +59,6 @@ Future<void> 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');
|
||||
});
|
||||
|
@ -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();
|
||||
|
@ -48,7 +48,6 @@ void main([List<String> args = const <String>[]]) {
|
||||
..removeAll(kProfiledDemos);
|
||||
await runDemos(unprofiledDemos.toList(), tester);
|
||||
},
|
||||
timeout: const Timeout(Duration(minutes: 5)),
|
||||
semanticsEnabled: withSemantics,
|
||||
);
|
||||
});
|
||||
|
@ -5,7 +5,6 @@
|
||||
import 'package:integration_test/integration_test_driver.dart' as driver;
|
||||
|
||||
Future<void> main() => driver.integrationDriver(
|
||||
timeout: const Duration(minutes: 5),
|
||||
responseDataCallback: (Map<String, dynamic>? data) async {
|
||||
await driver.writeResponseData(
|
||||
data!['performance'] as Map<String, dynamic>,
|
||||
|
@ -130,7 +130,6 @@ Future<void> runDemos(List<String> 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<String> args = const <String>[]]) {
|
||||
await runDemos(unprofiledDemos.toList(), driver);
|
||||
}
|
||||
|
||||
}, timeout: const Timeout(Duration(minutes: 5)));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -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'));
|
||||
});
|
||||
}
|
||||
|
@ -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'));
|
||||
});
|
||||
}
|
||||
|
@ -18,6 +18,6 @@ void main() {
|
||||
await driver.close();
|
||||
});
|
||||
|
||||
test('empty', () async {}, timeout: const Timeout(Duration(minutes: 1)));
|
||||
test('empty', () async {});
|
||||
});
|
||||
}
|
||||
|
@ -48,6 +48,6 @@ void main() {
|
||||
|
||||
imageBefore = imageAfter;
|
||||
}
|
||||
}, timeout: const Timeout(Duration(minutes: 2)));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ Future<void> writeResponseData(
|
||||
///
|
||||
/// ```
|
||||
Future<void> integrationDriver({
|
||||
Duration timeout = const Duration(minutes: 1),
|
||||
Duration timeout = const Duration(minutes: 20),
|
||||
ResponseDataCallback? responseDataCallback = writeResponseData,
|
||||
}) async {
|
||||
final FlutterDriver driver = await FlutterDriver.connect();
|
||||
|
Loading…
x
Reference in New Issue
Block a user