Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for flakey analyze test #111895

Merged
merged 7 commits into from Sep 19, 2022
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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) {
if (!analyzeLineFound && line.startsWith('Analyzing flutter_project')) {
eliasyishak marked this conversation as resolved.
Show resolved Hide resolved
analyzeLineFound = true;
return;
}

if (analyzeLineFound && line.isNotEmpty) {
errors.add(lineParser(line));
}
});

} 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