Skip to content

Commit 8a8616f

Browse files
authored
Handle FormatException from SkiaGoldClient (#143755)
Seen in https://ci.chromium.org/ui/p/flutter/builders/prod/Linux%20Framework%20Smoke%20Tests/17183/overview closing the engine tree.
1 parent 6200026 commit 8a8616f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

packages/flutter_goldens/lib/flutter_goldens.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,13 @@ class FlutterLocalFileComparator extends FlutterGoldenFileComparator with LocalC
507507
'SocketException occurred, could not reach Gold. '
508508
'Switching to FlutterSkippingGoldenFileComparator.',
509509
);
510+
} on FormatException catch (_) {
511+
return FlutterSkippingFileComparator(
512+
baseDirectory.uri,
513+
goldens,
514+
'FormatException occurred, could not reach Gold. '
515+
'Switching to FlutterSkippingGoldenFileComparator.',
516+
);
510517
}
511518

512519
return FlutterLocalFileComparator(baseDirectory.uri, goldens);

packages/flutter_goldens/test/flutter_goldens_test.dart

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,16 @@ void main() {
11601160
baseDirectory: fakeDirectory,
11611161
);
11621162
expect(comparator.runtimeType, FlutterSkippingFileComparator);
1163+
1164+
fakeSkiaClient.getExpectationForTestThrowable = const FormatException("Can't reach Gold");
1165+
1166+
comparator = await FlutterLocalFileComparator.fromDefaultComparator(
1167+
platform,
1168+
goldens: fakeSkiaClient,
1169+
baseDirectory: fakeDirectory,
1170+
);
1171+
expect(comparator.runtimeType, FlutterSkippingFileComparator);
1172+
11631173
// reset property or it will carry on to other tests
11641174
fakeSkiaClient.getExpectationForTestThrowable = null;
11651175
});

0 commit comments

Comments
 (0)