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.
This commit is contained in:
@@ -507,6 +507,13 @@ class FlutterLocalFileComparator extends FlutterGoldenFileComparator with LocalC
|
||||
'SocketException occurred, could not reach Gold. '
|
||||
'Switching to FlutterSkippingGoldenFileComparator.',
|
||||
);
|
||||
} on FormatException catch (_) {
|
||||
return FlutterSkippingFileComparator(
|
||||
baseDirectory.uri,
|
||||
goldens,
|
||||
'FormatException occurred, could not reach Gold. '
|
||||
'Switching to FlutterSkippingGoldenFileComparator.',
|
||||
);
|
||||
}
|
||||
|
||||
return FlutterLocalFileComparator(baseDirectory.uri, goldens);
|
||||
|
||||
@@ -1160,6 +1160,16 @@ void main() {
|
||||
baseDirectory: fakeDirectory,
|
||||
);
|
||||
expect(comparator.runtimeType, FlutterSkippingFileComparator);
|
||||
|
||||
fakeSkiaClient.getExpectationForTestThrowable = const FormatException("Can't reach Gold");
|
||||
|
||||
comparator = await FlutterLocalFileComparator.fromDefaultComparator(
|
||||
platform,
|
||||
goldens: fakeSkiaClient,
|
||||
baseDirectory: fakeDirectory,
|
||||
);
|
||||
expect(comparator.runtimeType, FlutterSkippingFileComparator);
|
||||
|
||||
// reset property or it will carry on to other tests
|
||||
fakeSkiaClient.getExpectationForTestThrowable = null;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user