Commit 0ec3ffb4 authored by Yegor's avatar Yegor Committed by GitHub

increase total task timeout; decrease individual benchmark timeout (#9063)

parent 3ef99092
...@@ -16,7 +16,7 @@ import 'utils.dart'; ...@@ -16,7 +16,7 @@ import 'utils.dart';
/// Maximum amount of time a single task is allowed to take to run. /// Maximum amount of time a single task is allowed to take to run.
/// ///
/// If exceeded the task is considered to have failed. /// If exceeded the task is considered to have failed.
const Duration taskTimeout = const Duration(minutes: 10); const Duration taskTimeout = const Duration(minutes: 25);
/// Represents a unit of work performed in the CI environment that can /// Represents a unit of work performed in the CI environment that can
/// succeed, fail and be retried independently of others. /// succeed, fail and be retried independently of others.
......
...@@ -12,7 +12,7 @@ import 'package:flutter_devicelab/framework/utils.dart'; ...@@ -12,7 +12,7 @@ import 'package:flutter_devicelab/framework/utils.dart';
/// Slightly longer than task timeout that gives the task runner a chance to /// Slightly longer than task timeout that gives the task runner a chance to
/// clean-up before forcefully quitting it. /// clean-up before forcefully quitting it.
const Duration taskTimeoutWithGracePeriod = const Duration(minutes: 11); const Duration taskTimeoutWithGracePeriod = const Duration(minutes: 26);
/// Runs a task in a separate Dart VM and collects the result using the VM /// Runs a task in a separate Dart VM and collects the result using the VM
/// service protocol. /// service protocol.
......
...@@ -13,6 +13,9 @@ import 'package:flutter_devicelab/framework/framework.dart'; ...@@ -13,6 +13,9 @@ import 'package:flutter_devicelab/framework/framework.dart';
import 'package:flutter_devicelab/framework/ios.dart'; import 'package:flutter_devicelab/framework/ios.dart';
import 'package:flutter_devicelab/framework/utils.dart'; import 'package:flutter_devicelab/framework/utils.dart';
/// The maximum amount of time a single microbenchmarks is allowed to take.
const Duration _kBenchmarkTimeout = const Duration(minutes: 6);
/// Creates a device lab task that runs benchmarks in /// Creates a device lab task that runs benchmarks in
/// `dev/benchmarks/microbenchmarks` reports results to the dashboard. /// `dev/benchmarks/microbenchmarks` reports results to the dashboard.
TaskFunction createMicrobenchmarkTask() { TaskFunction createMicrobenchmarkTask() {
...@@ -21,24 +24,29 @@ TaskFunction createMicrobenchmarkTask() { ...@@ -21,24 +24,29 @@ TaskFunction createMicrobenchmarkTask() {
await device.unlock(); await device.unlock();
Future<Map<String, double>> _runMicrobench(String benchmarkPath) async { Future<Map<String, double>> _runMicrobench(String benchmarkPath) async {
print('Running $benchmarkPath'); Future<Map<String, double>> _run() async {
final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/benchmarks/microbenchmarks')); print('Running $benchmarkPath');
final Process flutterProcess = await inDirectory(appDir, () async { final Directory appDir = dir(
if (deviceOperatingSystem == DeviceOperatingSystem.ios) { path.join(flutterDirectory.path, 'dev/benchmarks/microbenchmarks'));
await prepareProvisioningCertificates(appDir.path); final Process flutterProcess = await inDirectory(appDir, () async {
} if (deviceOperatingSystem == DeviceOperatingSystem.ios) {
return await _startFlutter( await prepareProvisioningCertificates(appDir.path);
options: <String>[ }
'--profile', // --release doesn't work on iOS due to code signing issues return await _startFlutter(
'-d', options: <String>[
device.deviceId, '--profile',
benchmarkPath, // --release doesn't work on iOS due to code signing issues
], '-d',
canFail: false, device.deviceId,
); benchmarkPath,
}); ],
canFail: false,
return await _readJsonResults(flutterProcess); );
});
return await _readJsonResults(flutterProcess);
}
return _run().timeout(_kBenchmarkTimeout);
} }
final Map<String, double> allResults = <String, double>{}; final Map<String, double> allResults = <String, double>{};
......
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