Skip to content

Log stdout in adb.dart#187531

Queued
gmackall wants to merge 6 commits into
flutter:masterfrom
gmackall:log_stderr
Queued

Log stdout in adb.dart#187531
gmackall wants to merge 6 commits into
flutter:masterfrom
gmackall:log_stderr

Conversation

@gmackall
Copy link
Copy Markdown
Member

@gmackall gmackall commented Jun 3, 2026

there are cases where the logs seem to show nothing. Presumably the error was actually on stdout?

Log the stdout as well in each case.

ex:

VMServiceFlutterDriver: Connecting to Flutter application at http://127.0.0.1:35881/RbdYvy0mjAY=/
VMServiceFlutterDriver: Isolate found with number: 996155999383631
VMServiceFlutterDriver: Isolate 996155999383631 is runnable.
VMServiceFlutterDriver: Isolate is paused at start.
VMServiceFlutterDriver: Attempting to resume isolate
VMServiceFlutterDriver: Connected to Flutter application.
D/FlutterJNI( 7695): Sending viewport metrics to the engine.
I/PlatformViewsChannel( 7695): Using legacy platform view rendering strategy.
I/PlatformViewsController( 7695): Using hybrid composition for platform view: 0
I/MESA    ( 7695): exportSyncFdForQSRILocked: call for image 0x7f3d16359350 hos timage handle 0x70004000012d9
I/MESA    ( 7695): exportSyncFdForQSRILocked: got fd: 150
D/FlutterJNI( 7695): Sending viewport metrics to the engine.
I/MESA    ( 7695): exportSyncFdForQSRILocked: call for image 0x7f3d16358fd0 hos timage handle 0x70004000012da
I/MESA    ( 7695): exportSyncFdForQSRILocked: got fd: 157
00:35 +0 -1: (setUpAll) [E]
  Bad state: Failed to disable animations: 
  package:android_driver_extensions/src/backend/android/adb.dart 172:9    Adb.disableAnimations
  ===== asynchronous gap ===========================
  package:android_driver_extensions/src/backend/android/driver.dart 66:5  AndroidNativeDriver.configureForScreenshotTesting
  ===== asynchronous gap ===========================
  test_driver/platform_view/hide_show_hide_main_test.dart 22:5            main.<fn>

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8681252155845819249/+/u/run_test.dart_for_android_engine_vulkan_tests_shard_and_subshard_None/stdout

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 3, 2026
@gmackall gmackall marked this pull request as ready for review June 3, 2026 19:54
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 3, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates several ADB helper methods in adb.dart to include both stdout and stderr in error messages upon command failure, and updates the corresponding test expectations in adb_fake_io_test.dart. Feedback suggests decoding the binary stdout using utf8.decode in the screencap() method to ensure the error message remains human-readable instead of printing a raw byte list.

Comment on lines +85 to +87
throw StateError(
'Failed to take screenshot: stderr: ${result.stderr}, stdout: ${result.stdout}',
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In screencap(), result is an AdbBinaryResult where result.stdout is a Uint8List (binary data). Interpolating a Uint8List directly into a string will print its default string representation (e.g., a list of byte integers like [101, 114, 114, 111, 114] or Instance of 'Uint8List'), which is not human-readable.

To log the actual text output, decode the Uint8List using utf8.decode (from dart:convert).

Suggested change
throw StateError(
'Failed to take screenshot: stderr: ${result.stderr}, stdout: ${result.stdout}',
);
throw StateError(
'Failed to take screenshot: stderr: ${result.stderr}, stdout: ${utf8.decode(result.stdout, allowMalformed: true)}',
);

@gmackall gmackall added the CICD Run CI/CD label Jun 3, 2026
…b.dart

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@gmackall gmackall requested review from a team and camsim99 and removed request for a team June 4, 2026 16:21
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 4, 2026
@gmackall gmackall added the CICD Run CI/CD label Jun 4, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 4, 2026
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 4, 2026
Copy link
Copy Markdown
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 4, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants