From 5c6e3f03c0ba13002e05e34d05bd1ee51c75bbfe Mon Sep 17 00:00:00 2001 From: gaaclarke <30870216+gaaclarke@users.noreply.github.com> Date: Wed, 9 Oct 2024 08:40:04 -0700 Subject: [PATCH] Started handling duplicate validation layer messages (#156375) fixes https://github.com/flutter/flutter/issues/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 https://github.com/flutter/flutter/issues/151528#issuecomment-2398189205 ## 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]. [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 --- dev/devicelab/bin/tasks/hello_world_impeller.dart | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dev/devicelab/bin/tasks/hello_world_impeller.dart b/dev/devicelab/bin/tasks/hello_world_impeller.dart index d094882fda..8b86c864f7 100644 --- a/dev/devicelab/bin/tasks/hello_world_impeller.dart +++ b/dev/devicelab/bin/tasks/hello_world_impeller.dart @@ -22,24 +22,25 @@ Future run() async { bool isUsingValidationLayers = false; bool hasValidationErrors = false; - int impellerBackendCount = 0; + int invalidBackendCount = 0; final Completer didReceiveBackendMessage = Completer(); await inDirectory(appDir, () async { await flutter('packages', options: ['get']); - + const String validationLayersMessage = 'Using the Impeller rendering backend (Vulkan with Validation Layers)'; final StreamSubscription adb = device.logcat.listen( (String data) { if (data.contains('Using the Impeller rendering backend')) { // Sometimes more than one of these will be printed out if there is a // fallback. + if (!data.contains(validationLayersMessage)) { + invalidBackendCount += 1; + } if (!didReceiveBackendMessage.isCompleted) { didReceiveBackendMessage.complete(); } - impellerBackendCount += 1; } - if (data.contains( - 'Using the Impeller rendering backend (Vulkan with Validation Layers)')) { + if (data.contains(validationLayersMessage)) { isUsingValidationLayers = true; } // "ImpellerValidationBreak" comes from the engine: @@ -68,7 +69,7 @@ Future run() async { await adb.cancel(); }); - if (!isUsingValidationLayers || impellerBackendCount != 1) { + if (!isUsingValidationLayers || invalidBackendCount != 0) { return TaskResult.failure('Not using Vulkan validation layers.'); } if (hasValidationErrors){