Unverified Commit 9e87a5b0 authored by Elias Yishak's avatar Elias Yishak Committed by GitHub

fix for flakey analyze test (#111895)

parent 2e3b03fd
...@@ -3131,22 +3131,25 @@ Future<void> _analyzeProject(String workingDir, { List<String> expectedFailures ...@@ -3131,22 +3131,25 @@ Future<void> _analyzeProject(String workingDir, { List<String> expectedFailures
} }
} }
final String stdout = exec.stdout.toString(); final String stdout = exec.stdout.toString();
final List<String> errors; final List<String> errors = <String>[];
try { try {
errors = const LineSplitter().convert(stdout) bool analyzeLineFound = false;
.where((String line) { const LineSplitter().convert(stdout).forEach((String line) {
return line.trim().isNotEmpty && // Conditional to filter out any stdout from `pub get`
!line.startsWith('Analyzing') && if (!analyzeLineFound && line.startsWith('Analyzing')) {
!line.contains('flutter pub get') && analyzeLineFound = true;
!line.contains('Resolving dependencies') && return;
!line.contains('Got dependencies'); }
}).map(lineParser).toList();
if (analyzeLineFound && line.trim().isNotEmpty) {
// Add debugging for https://github.com/flutter/flutter/issues/111272 errors.add(lineParser(line.trim()));
} on RangeError catch (err) { }
});
} on Exception catch (err) {
fail('$err\n\nComplete STDOUT was:\n\n$stdout'); fail('$err\n\nComplete STDOUT was:\n\n$stdout');
} }
expect(errors, unorderedEquals(expectedFailures)); expect(errors, unorderedEquals(expectedFailures),
reason: 'Failed with stdout:\n\n$stdout');
} }
Future<void> _getPackages(Directory workingDir) async { Future<void> _getPackages(Directory workingDir) async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment