From 54236427dcf1e7a325d3661828a4ba906483cfc7 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Thu, 20 Sep 2018 14:45:24 -0700 Subject: [PATCH] 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. --- packages/flutter_tools/test/base/logger_test.dart | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/flutter_tools/test/base/logger_test.dart b/packages/flutter_tools/test/base/logger_test.dart index ebf116cf49..b9d19dbc16 100644 --- a/packages/flutter_tools/test/base/logger_test.dart +++ b/packages/flutter_tools/test/base/logger_test.dart @@ -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(), [ - '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: { Stdio: () => mockStdio, Logger: () => StdoutLogger()..supportsColor = false,