From 9160c6e7f1125c0ff4584c47770a0a6192591fde Mon Sep 17 00:00:00 2001 From: Elias Yishak <42216813+eliasyishak@users.noreply.github.com> Date: Wed, 3 May 2023 10:50:10 -0400 Subject: [PATCH] Adding printOnFailure for result of process (#125910) Adding a `printOnFailure` call into the flakey test to help debug the cause for future failures. - Reference issue: https://github.com/flutter/flutter/issues/125512 --- .../integration.shard/analyze_size_test.dart | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/flutter_tools/test/integration.shard/analyze_size_test.dart b/packages/flutter_tools/test/integration.shard/analyze_size_test.dart index d041f171a8..0deac35fab 100644 --- a/packages/flutter_tools/test/integration.shard/analyze_size_test.dart +++ b/packages/flutter_tools/test/integration.shard/analyze_size_test.dart @@ -177,7 +177,7 @@ void main() { final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter'); final Directory tempDir = fileSystem.systemTempDirectory.createTempSync('flutter_size_test.'); - final ProcessResult result = await processManager.run([ + final List command = [ flutterBin, 'build', 'apk', @@ -185,7 +185,21 @@ void main() { '--code-size-directory=${tempDir.path}', '--target-platform=android-arm64', '--release', - ], workingDirectory: fileSystem.path.join(getFlutterRoot(), 'examples', 'hello_world')); + ]; + final String workingDirectory = fileSystem.path.join( + getFlutterRoot(), + 'examples', + 'hello_world', + ); + final ProcessResult result = await processManager.run( + command, + workingDirectory: workingDirectory, + ); + + printOnFailure('workingDirectory: $workingDirectory'); + printOnFailure('command:\n${command.join(" ")}'); + printOnFailure('stdout:\n${result.stdout}'); + printOnFailure('stderr:\n${result.stderr}'); expect(result.exitCode, 0); expect(tempDir.existsSync(), true);