mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fail lazily when 1+ Skia gold comparions fail. (flutter/engine#51010)
(Speculative) fix for https://github.com/flutter/flutter/issues/144238. @zanderso Could you review from a CLI angle? I realize this code is not great, but could I do something better here?
This commit is contained in:
parent
186f661615
commit
75bfeb8fb0
@ -157,6 +157,7 @@ Future<void> _run({
|
||||
late final ServerSocket server;
|
||||
final List<Future<void>> pendingComparisons = <Future<void>>[];
|
||||
final List<Socket> pendingConnections = <Socket>[];
|
||||
int comparisonsFailed = 0;
|
||||
await step('Starting server...', () async {
|
||||
server = await ServerSocket.bind(InternetAddress.anyIPv4, _tcpPort);
|
||||
if (verbose) {
|
||||
@ -186,8 +187,9 @@ Future<void> _run({
|
||||
if (isSkiaGoldClientAvailable) {
|
||||
final Future<void> comparison = skiaGoldClient!
|
||||
.addImg(fileName, goldenFile, screenshotSize: screenshot.pixelCount)
|
||||
.catchError((dynamic err) {
|
||||
panic(<String>['skia gold comparison failed: $err']);
|
||||
.catchError((Object error) {
|
||||
logWarning('skia gold comparison failed: $error');
|
||||
comparisonsFailed++;
|
||||
});
|
||||
pendingComparisons.add(comparison);
|
||||
}
|
||||
@ -354,6 +356,8 @@ Future<void> _run({
|
||||
if (out.toString().contains('FAILURES!!!')) {
|
||||
stdout.write(out);
|
||||
panic(<String>['1 or more tests failed']);
|
||||
} else if (comparisonsFailed > 0) {
|
||||
panic(<String>['$comparisonsFailed Skia Gold comparisons failed']);
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user