log full timeline when transition test fails; print stack chain in task errors (#6772)
This commit is contained in:
@@ -59,6 +59,8 @@ final List<String> demoTitles = <String>[
|
||||
'Typography'
|
||||
];
|
||||
|
||||
final FileSystem _fs = new LocalFileSystem();
|
||||
|
||||
Future<Null> saveDurationsHistogram(List<Map<String, dynamic>> events) async {
|
||||
final Map<String, List<int>> durations = new Map<String, List<int>>();
|
||||
Map<String, dynamic> startEvent;
|
||||
@@ -87,9 +89,8 @@ Future<Null> saveDurationsHistogram(List<Map<String, dynamic>> events) async {
|
||||
|
||||
// Save the durations Map to a file.
|
||||
final String destinationDirectory = 'build';
|
||||
final FileSystem fs = new LocalFileSystem();
|
||||
await fs.directory(destinationDirectory).create(recursive: true);
|
||||
final File file = fs.file(path.join(destinationDirectory, 'transition_durations.timeline.json'));
|
||||
await _fs.directory(destinationDirectory).create(recursive: true);
|
||||
final File file = _fs.file(path.join(destinationDirectory, 'transition_durations.timeline.json'));
|
||||
await file.writeAsString(new JsonEncoder.withIndent(' ').convert(durations));
|
||||
}
|
||||
|
||||
@@ -136,10 +137,16 @@ void main() {
|
||||
// Save the duration (in microseconds) of the first timeline Frame event
|
||||
// that follows a 'Start Transition' event. The Gallery app adds a
|
||||
// 'Start Transition' event when a demo is launched (see GalleryItem).
|
||||
saveDurationsHistogram(timeline.json['traceEvents']);
|
||||
|
||||
TimelineSummary summary = new TimelineSummary.summarize(timeline);
|
||||
summary.writeSummaryToFile('transitions');
|
||||
summary.writeSummaryToFile('transitions', pretty: true);
|
||||
try {
|
||||
saveDurationsHistogram(timeline.json['traceEvents']);
|
||||
} catch(_) {
|
||||
summary.writeTimelineToFile('transitions', pretty: true);
|
||||
print('ERROR: failed to extract transition events. Here is the full timeline:\n');
|
||||
print(await _fs.file('build/transitions.timeline.json').readAsString());
|
||||
rethrow;
|
||||
}
|
||||
|
||||
}, timeout: new Timeout(new Duration(minutes: 5)));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user