Fix flake in logger_test (#22095)

This fixes a flaky test where it included 0ms as part of an output check. Kind of a classic flaky test.
This commit is contained in:
Greg Spencer
2018-09-20 14:45:24 -07:00
committed by GitHub
parent 72d86f904f
commit 54236427dc

View File

@@ -281,11 +281,9 @@ void main() {
testUsingContext('sequential startProgress calls with StdoutLogger', () async {
context[Logger].startProgress('AAA')..stop();
context[Logger].startProgress('BBB')..stop();
expect(outputStdout(), <String>[
'AAA 0ms',
'BBB 0ms',
'',
]);
expect(outputStdout().length, equals(3));
expect(outputStdout()[0], matches(RegExp(r'AAA[ ]{60}[\d ]{3}[\d]ms')));
expect(outputStdout()[1], matches(RegExp(r'BBB[ ]{60}[\d ]{3}[\d]ms')));
}, overrides: <Type, Generator>{
Stdio: () => mockStdio,
Logger: () => StdoutLogger()..supportsColor = false,