From f5dcbdab3a3cd1337711272298054202c6a19032 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 15 Aug 2019 10:16:30 -0700 Subject: [PATCH] Increase pattern that matches operation duration. (#36392) On Flutter HHH buildbot some operations that over a second: 4 digits for milliseconds, rather than 3 that are currently allowed. --- .../test/general.shard/base/logger_test.dart | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/flutter_tools/test/general.shard/base/logger_test.dart b/packages/flutter_tools/test/general.shard/base/logger_test.dart index 3e36fee5f6..9c80e51b0c 100644 --- a/packages/flutter_tools/test/general.shard/base/logger_test.dart +++ b/packages/flutter_tools/test/general.shard/base/logger_test.dart @@ -32,10 +32,10 @@ void main() { verboseLogger.printTrace('Oooh, I do I do I do'); verboseLogger.printError('Helpless!'); - expect(mockLogger.statusText, matches(r'^\[ (?: {0,2}\+[0-9]{1,3} ms| )\] Hey Hey Hey Hey\n' - r'\[ (?: {0,2}\+[0-9]{1,3} ms| )\] Oooh, I do I do I do\n$')); + expect(mockLogger.statusText, matches(r'^\[ (?: {0,2}\+[0-9]{1,4} ms| )\] Hey Hey Hey Hey\n' + r'\[ (?: {0,2}\+[0-9]{1,4} ms| )\] Oooh, I do I do I do\n$')); expect(mockLogger.traceText, ''); - expect(mockLogger.errorText, matches( r'^\[ (?: {0,2}\+[0-9]{1,3} ms| )\] Helpless!\n$')); + expect(mockLogger.errorText, matches( r'^\[ (?: {0,2}\+[0-9]{1,4} ms| )\] Helpless!\n$')); }, overrides: { OutputPreferences: () => OutputPreferences(showColor: false), Platform: _kNoAnsiPlatform, @@ -51,12 +51,12 @@ void main() { expect( mockLogger.statusText, - matches(r'^\[ (?: {0,2}\+[0-9]{1,3} ms| )\] ' '${bold}Hey Hey Hey Hey$resetBold' - r'\n\[ (?: {0,2}\+[0-9]{1,3} ms| )\] Oooh, I do I do I do\n$')); + matches(r'^\[ (?: {0,2}\+[0-9]{1,4} ms| )\] ' '${bold}Hey Hey Hey Hey$resetBold' + r'\n\[ (?: {0,2}\+[0-9]{1,4} ms| )\] Oooh, I do I do I do\n$')); expect(mockLogger.traceText, ''); expect( mockLogger.errorText, - matches('^$red' r'\[ (?: {0,2}\+[0-9]{1,3} ms| )\] ' '${bold}Helpless!$resetBold$resetColor' r'\n$')); + matches('^$red' r'\[ (?: {0,2}\+[0-9]{1,4} ms| )\] ' '${bold}Helpless!$resetBold$resetColor' r'\n$')); }, overrides: { OutputPreferences: () => OutputPreferences(showColor: true), Platform: () => FakePlatform()..stdoutSupportsAnsi = true, @@ -681,10 +681,10 @@ void main() { logger.startProgress('AAA', timeout: timeoutConfiguration.fastOperation)..stop(); logger.startProgress('BBB', timeout: timeoutConfiguration.fastOperation)..stop(); expect(outputStdout(), [ - matches(r'^\[ (?: {0,2}\+[0-9]{1,3} ms| )\] AAA$'), - matches(r'^\[ (?: {0,2}\+[0-9]{1,3} ms| )\] AAA \(completed.*\)$'), - matches(r'^\[ (?: {0,2}\+[0-9]{1,3} ms| )\] BBB$'), - matches(r'^\[ (?: {0,2}\+[0-9]{1,3} ms| )\] BBB \(completed.*\)$'), + matches(r'^\[ (?: {0,2}\+[0-9]{1,4} ms| )\] AAA$'), + matches(r'^\[ (?: {0,2}\+[0-9]{1,4} ms| )\] AAA \(completed.*\)$'), + matches(r'^\[ (?: {0,2}\+[0-9]{1,4} ms| )\] BBB$'), + matches(r'^\[ (?: {0,2}\+[0-9]{1,4} ms| )\] BBB \(completed.*\)$'), matches(r'^$'), ]); }, overrides: {