Skip to content

Commit 9160c6e

Browse files
authored
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: flutter/flutter#125512
1 parent c4d6c8c commit 9160c6e

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

packages/flutter_tools/test/integration.shard/analyze_size_test.dart

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,29 @@ void main() {
177177
final String flutterBin = fileSystem.path.join(getFlutterRoot(), 'bin', 'flutter');
178178
final Directory tempDir = fileSystem.systemTempDirectory.createTempSync('flutter_size_test.');
179179

180-
final ProcessResult result = await processManager.run(<String>[
180+
final List<String> command = <String>[
181181
flutterBin,
182182
'build',
183183
'apk',
184184
'--analyze-size',
185185
'--code-size-directory=${tempDir.path}',
186186
'--target-platform=android-arm64',
187187
'--release',
188-
], workingDirectory: fileSystem.path.join(getFlutterRoot(), 'examples', 'hello_world'));
188+
];
189+
final String workingDirectory = fileSystem.path.join(
190+
getFlutterRoot(),
191+
'examples',
192+
'hello_world',
193+
);
194+
final ProcessResult result = await processManager.run(
195+
command,
196+
workingDirectory: workingDirectory,
197+
);
198+
199+
printOnFailure('workingDirectory: $workingDirectory');
200+
printOnFailure('command:\n${command.join(" ")}');
201+
printOnFailure('stdout:\n${result.stdout}');
202+
printOnFailure('stderr:\n${result.stderr}');
189203

190204
expect(result.exitCode, 0);
191205
expect(tempDir.existsSync(), true);

0 commit comments

Comments
 (0)