Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
cffd5517
Commit
cffd5517
authored
Nov 09, 2016
by
Yegor
Committed by
GitHub
Nov 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log full timeline when transition test fails; print stack chain in task errors (#6772)
parent
d6343077
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
15 deletions
+31
-15
framework.dart
dev/devicelab/lib/framework/framework.dart
+18
-9
transitions_perf_test.dart
...es/flutter_gallery/test_driver/transitions_perf_test.dart
+13
-6
No files found.
dev/devicelab/lib/framework/framework.dart
View file @
cffd5517
...
...
@@ -9,6 +9,7 @@ import 'dart:io';
import
'dart:isolate'
;
import
'package:logging/logging.dart'
;
import
'package:stack_trace/stack_trace.dart'
;
import
'utils.dart'
;
...
...
@@ -115,16 +116,24 @@ class _TaskRunner {
_keepAlivePort
?.
close
();
}
Future
<
TaskResult
>
_performTask
()
async
{
try
{
return
await
task
();
}
catch
(
taskError
,
taskErrorStack
)
{
Future
<
TaskResult
>
_performTask
()
{
Completer
<
TaskResult
>
completer
=
new
Completer
<
TaskResult
>();
Chain
.
capture
(()
async
{
completer
.
complete
(
await
task
());
},
onError:
(
dynamic
taskError
,
Chain
taskErrorStack
)
{
String
message
=
'Task failed:
$taskError
'
;
if
(
taskErrorStack
!=
null
)
{
message
+=
'
\n\n
$taskErrorStack
'
;
}
return
new
TaskResult
.
failure
(
message
);
}
stderr
..
writeln
(
message
)
..
writeln
(
'
\n
Stack trace:'
)
..
writeln
(
taskErrorStack
.
terse
);
// IMPORTANT: We're completing the future _successfully_ but with a value
// that indicates a task failure. This is intentional. At this point we
// are catching errors coming from arbitrary (and untrustworthy) task
// code. Our goal is to convert the failure into a readable message.
// Propagating it further is not useful.
completer
.
complete
(
new
TaskResult
.
failure
(
message
));
});
return
completer
.
future
;
}
}
...
...
examples/flutter_gallery/test_driver/transitions_perf_test.dart
View file @
cffd5517
...
...
@@ -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
)));
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment