Skip to content

Commit

Permalink
fix for flakey analyze test (#111895)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasyishak committed Sep 19, 2022
1 parent 2e3b03f commit 9e87a5b
Showing 1 changed file with 16 additions and 13 deletions.
Expand Up @@ -3131,22 +3131,25 @@ Future<void> _analyzeProject(String workingDir, { List<String> expectedFailures
}
}
final String stdout = exec.stdout.toString();
final List<String> errors;
final List<String> errors = <String>[];
try {
errors = const LineSplitter().convert(stdout)
.where((String line) {
return line.trim().isNotEmpty &&
!line.startsWith('Analyzing') &&
!line.contains('flutter pub get') &&
!line.contains('Resolving dependencies') &&
!line.contains('Got dependencies');
}).map(lineParser).toList();

// Add debugging for https://github.com/flutter/flutter/issues/111272
} on RangeError catch (err) {
bool analyzeLineFound = false;
const LineSplitter().convert(stdout).forEach((String line) {
// Conditional to filter out any stdout from `pub get`
if (!analyzeLineFound && line.startsWith('Analyzing')) {
analyzeLineFound = true;
return;
}

if (analyzeLineFound && line.trim().isNotEmpty) {
errors.add(lineParser(line.trim()));
}
});
} on Exception catch (err) {
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 {
Expand Down

0 comments on commit 9e87a5b

Please sign in to comment.