From 12cf9de68b090c90de016fcfc24c4636180332be Mon Sep 17 00:00:00 2001 From: Christopher Fujino Date: Thu, 24 Aug 2023 10:03:17 -0700 Subject: [PATCH] Fix mac tool_integration_tests with Xcode 15 (#133217) Fixes https://github.com/flutter/flutter/issues/132990 --- .../test/integration.shard/test_test.dart | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/packages/flutter_tools/test/integration.shard/test_test.dart b/packages/flutter_tools/test/integration.shard/test_test.dart index 86e0d11bdc2..c48d354c093 100644 --- a/packages/flutter_tools/test/integration.shard/test_test.dart +++ b/packages/flutter_tools/test/integration.shard/test_test.dart @@ -335,7 +335,10 @@ Future _testFile( reason: '"$testName" returned code ${exec.exitCode}\n\nstdout:\n' '${exec.stdout}\nstderr:\n${exec.stderr}', ); - final List output = (exec.stdout as String).split('\n'); + List output = (exec.stdout as String).split('\n'); + + output = _removeMacFontServerWarning(output); + if (output.first.startsWith('Waiting for another flutter command to release the startup lock...')) { output.removeAt(0); } @@ -398,6 +401,26 @@ Future _testFile( } } +final RegExp _fontServerProtocolPattern = RegExp(r'flutter_tester.*Font server protocol version mismatch'); +final RegExp _unableToConnectToFontDaemonPattern = RegExp(r'flutter_tester.*XType: unable to make a connection to the font daemon!'); +final RegExp _xtFontStaticRegistryPattern = RegExp(r'flutter_tester.*XType: XTFontStaticRegistry is enabled as fontd is not available'); + +// https://github.com/flutter/flutter/issues/132990 +List _removeMacFontServerWarning(List output) { + return output.where((String line) { + if (_fontServerProtocolPattern.hasMatch(line)) { + return false; + } + if (_unableToConnectToFontDaemonPattern.hasMatch(line)) { + return false; + } + if (_xtFontStaticRegistryPattern.hasMatch(line)) { + return false; + } + return true; + }).toList(); +} + Future _runFlutterTest( String? testName, String workingDirectory,