From ff0ab6ba450d61303d30e4ae737e63a76e252dc0 Mon Sep 17 00:00:00 2001 From: Yegor Date: Wed, 5 Jun 2024 15:44:01 -0700 Subject: [PATCH] Send q once (#149767) The previous expression `success || line.contains('--- TEST FAILED ---')` made it such that as soon as success is reported, the test would send "q" on every line of stdout, which is wrong. This fixes the condition such that "q" is sent once, only when `--- TEST SUCCEEDED ---` or `--- TEST FAILED ---` is printed. --- dev/bots/suite_runners/run_web_tests.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dev/bots/suite_runners/run_web_tests.dart b/dev/bots/suite_runners/run_web_tests.dart index d3b4a380d28..1a1260e95eb 100644 --- a/dev/bots/suite_runners/run_web_tests.dart +++ b/dev/bots/suite_runners/run_web_tests.dart @@ -521,6 +521,7 @@ class WebTestsSuite { flutter, [ 'run', + '--verbose', '--debug', '-d', 'chrome', @@ -533,10 +534,15 @@ class WebTestsSuite { ], outputMode: OutputMode.capture, outputListener: (String line, Process process) { + bool shutdownFlutterTool = false; if (line.contains('--- TEST SUCCEEDED ---')) { success = true; + shutdownFlutterTool = true; } - if (success || line.contains('--- TEST FAILED ---')) { + if (line.contains('--- TEST FAILED ---')) { + shutdownFlutterTool = true; + } + if (shutdownFlutterTool) { process.stdin.add('q'.codeUnits); } },