Skip to content

Commit 5c6e3f0

Browse files
authored
Started handling duplicate validation layer messages (#156375)
fixes flutter/flutter#151528 Those tests were failing because the validation layers messages were printing out twice. This now only starts failing if a backend is reported that is not vulkan with validation layers. See flutter/flutter#151528 (comment) ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
1 parent 0baf7a5 commit 5c6e3f0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

dev/devicelab/bin/tasks/hello_world_impeller.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,25 @@ Future<TaskResult> run() async {
2222

2323
bool isUsingValidationLayers = false;
2424
bool hasValidationErrors = false;
25-
int impellerBackendCount = 0;
25+
int invalidBackendCount = 0;
2626
final Completer<void> didReceiveBackendMessage = Completer<void>();
2727

2828
await inDirectory(appDir, () async {
2929
await flutter('packages', options: <String>['get']);
30-
30+
const String validationLayersMessage = 'Using the Impeller rendering backend (Vulkan with Validation Layers)';
3131
final StreamSubscription<String> adb = device.logcat.listen(
3232
(String data) {
3333
if (data.contains('Using the Impeller rendering backend')) {
3434
// Sometimes more than one of these will be printed out if there is a
3535
// fallback.
36+
if (!data.contains(validationLayersMessage)) {
37+
invalidBackendCount += 1;
38+
}
3639
if (!didReceiveBackendMessage.isCompleted) {
3740
didReceiveBackendMessage.complete();
3841
}
39-
impellerBackendCount += 1;
4042
}
41-
if (data.contains(
42-
'Using the Impeller rendering backend (Vulkan with Validation Layers)')) {
43+
if (data.contains(validationLayersMessage)) {
4344
isUsingValidationLayers = true;
4445
}
4546
// "ImpellerValidationBreak" comes from the engine:
@@ -68,7 +69,7 @@ Future<TaskResult> run() async {
6869
await adb.cancel();
6970
});
7071

71-
if (!isUsingValidationLayers || impellerBackendCount != 1) {
72+
if (!isUsingValidationLayers || invalidBackendCount != 0) {
7273
return TaskResult.failure('Not using Vulkan validation layers.');
7374
}
7475
if (hasValidationErrors){

0 commit comments

Comments
 (0)