Performance test cleanup (#20652)

* Fix TODO syntax.
* Clarify messages for some timeouts, to aid debugging.
* Increase some other timeouts that were a needlessly short, to reduce sources of flakes.
* Remove some more timeouts that were mostly redundant, to remove complexity.
* Minor style cleanup.
* Remove some dangerous traps (specifically, hide the explicit start/end times in TimedEvent since they shouldn't matter).
This commit is contained in:
Ian Hickson
2018-08-17 13:19:28 -07:00
committed by GitHub
parent 03d6f18f4a
commit 1993a67381
6 changed files with 14 additions and 24 deletions

View File

@@ -37,7 +37,7 @@ Future<TaskResult> task(TaskFunction task) {
_isTaskRegistered = true;
// TODO: allow overriding logging.
// TODO(ianh): allow overriding logging.
Logger.root.level = Level.ALL;
Logger.root.onRecord.listen((LogRecord rec) {
print('${rec.level.name}: ${rec.time}: ${rec.message}');
@@ -53,7 +53,7 @@ class _TaskRunner {
final TaskFunction task;
// TODO: workaround for https://github.com/dart-lang/sdk/issues/23797
// TODO(ianh): workaround for https://github.com/dart-lang/sdk/issues/23797
RawReceivePort _keepAlivePort;
Timer _startTaskTimeout;
bool _taskStarted = false;
@@ -86,7 +86,7 @@ class _TaskRunner {
_completer.complete(result);
return result;
} on TimeoutException catch (_) {
print('Task timed out after $taskTimeout.');
print('Task timed out in framework.dart after $taskTimeout.');
return new TaskResult.failure('Task timed out after $taskTimeout');
} finally {
print('Cleaning up after task...');
@@ -106,7 +106,7 @@ class _TaskRunner {
_keepAlivePort = new RawReceivePort();
// Timeout if nothing bothers to connect and ask us to run the task.
const Duration taskStartTimeout = Duration(seconds: 10);
const Duration taskStartTimeout = Duration(seconds: 60);
_startTaskTimeout = new Timer(taskStartTimeout, () {
if (!_taskStarted) {
logger.severe('Task did not start in $taskStartTimeout.');