From 0ec3ffb4bc17f2c77d70b623300ba8dcaa48192d Mon Sep 17 00:00:00 2001 From: Yegor Date: Tue, 28 Mar 2017 15:42:06 -0700 Subject: [PATCH] increase total task timeout; decrease individual benchmark timeout (#9063) --- dev/devicelab/lib/framework/framework.dart | 2 +- dev/devicelab/lib/framework/runner.dart | 2 +- dev/devicelab/lib/tasks/microbenchmarks.dart | 42 ++++++++++++-------- 3 files changed, 27 insertions(+), 19 deletions(-) diff --git a/dev/devicelab/lib/framework/framework.dart b/dev/devicelab/lib/framework/framework.dart index 5d6d88ab62..b495eb69d6 100644 --- a/dev/devicelab/lib/framework/framework.dart +++ b/dev/devicelab/lib/framework/framework.dart @@ -16,7 +16,7 @@ import 'utils.dart'; /// Maximum amount of time a single task is allowed to take to run. /// /// 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 /// succeed, fail and be retried independently of others. diff --git a/dev/devicelab/lib/framework/runner.dart b/dev/devicelab/lib/framework/runner.dart index c4fcac2935..229f474293 100644 --- a/dev/devicelab/lib/framework/runner.dart +++ b/dev/devicelab/lib/framework/runner.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 /// 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 /// service protocol. diff --git a/dev/devicelab/lib/tasks/microbenchmarks.dart b/dev/devicelab/lib/tasks/microbenchmarks.dart index 2cb0515eb2..df8e47fb02 100644 --- a/dev/devicelab/lib/tasks/microbenchmarks.dart +++ b/dev/devicelab/lib/tasks/microbenchmarks.dart @@ -13,6 +13,9 @@ import 'package:flutter_devicelab/framework/framework.dart'; import 'package:flutter_devicelab/framework/ios.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 /// `dev/benchmarks/microbenchmarks` reports results to the dashboard. TaskFunction createMicrobenchmarkTask() { @@ -21,24 +24,29 @@ TaskFunction createMicrobenchmarkTask() { await device.unlock(); Future> _runMicrobench(String benchmarkPath) async { - print('Running $benchmarkPath'); - final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/benchmarks/microbenchmarks')); - final Process flutterProcess = await inDirectory(appDir, () async { - if (deviceOperatingSystem == DeviceOperatingSystem.ios) { - await prepareProvisioningCertificates(appDir.path); - } - return await _startFlutter( - options: [ - '--profile', // --release doesn't work on iOS due to code signing issues - '-d', - device.deviceId, - benchmarkPath, - ], - canFail: false, - ); - }); + Future> _run() async { + print('Running $benchmarkPath'); + final Directory appDir = dir( + path.join(flutterDirectory.path, 'dev/benchmarks/microbenchmarks')); + final Process flutterProcess = await inDirectory(appDir, () async { + if (deviceOperatingSystem == DeviceOperatingSystem.ios) { + await prepareProvisioningCertificates(appDir.path); + } + return await _startFlutter( + options: [ + '--profile', + // --release doesn't work on iOS due to code signing issues + '-d', + device.deviceId, + benchmarkPath, + ], + canFail: false, + ); + }); - return await _readJsonResults(flutterProcess); + return await _readJsonResults(flutterProcess); + } + return _run().timeout(_kBenchmarkTimeout); } final Map allResults = {};