Skip to content

Check for Android package before running memory tests #9706

@cbracken

Description

@cbracken

Steps to Reproduce

  1. In dev/devicelab/lib/tasks/perf_tests.dart, change the package of the hello_world test to something else (e.g., io.flutter.broken.hello_world).
  2. Run the above test.

Expected behaviour: error that no such package is present.
Actual behaviour: timeout

Looks like adb has an adb pm list packages command that might be useful as an test that the package exists.

Logs

[hello_world__memory] [STDOUT] [  +57 ms] Time to first frame: 396ms.
[hello_world__memory] [STDOUT] [        ] Saved startup trace info in build/start_up_info.json.
[hello_world__memory] [STDOUT] [        ] Application finished.
[hello_world__memory] [STDOUT] [  +19 ms] 'flutter run' took 34,753ms.
[hello_world__memory] [STDOUT] [  +39 ms] ensureAnalyticsSent: 37ms
[hello_world__memory] [STDOUT] [   +2 ms] exiting with code 0
[hello_world__memory] [STDOUT] Executing: /Users/cbracken/Library/Android/sdk/platform-tools/adb shell dumpsys meminfo io.flutter.examples.HelloWorld
[hello_world__memory] [STDERR] Task failed: NoSuchMethodError: The method 'group' was called on null.
[hello_world__memory] [STDERR] Receiver: null
[hello_world__memory] [STDERR] Tried calling: group(1)
[hello_world__memory] [STDERR]
[hello_world__memory] [STDERR] Stack trace:
[hello_world__memory] [STDERR] dart:core                                                  Object.noSuchMethod
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/adb.dart 263:35        AndroidDevice.getMemoryStats
[hello_world__memory] [STDERR] package:flutter_devicelab/tasks/perf_tests.dart 261:59     MemoryTest.call.<fn>
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/utils.dart 282:24      inDirectory
[hello_world__memory] [STDERR] package:flutter_devicelab/tasks/perf_tests.dart 234:12     MemoryTest.call
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/framework.dart 125:36  _TaskRunner._performTask.<fn>
[hello_world__memory] [STDERR] package:stack_trace                                        Chain.capture
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/framework.dart 124:11  _TaskRunner._performTask
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/framework.dart 84:39   _TaskRunner.run
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/framework.dart 69:39   _TaskRunner._TaskRunner.<fn>
[hello_world__memory] [STDERR] ===== asynchronous gap ===========================
[hello_world__memory] [STDERR] dart:async                                                 _Completer.completeError
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/adb.dart 265:3         AndroidDevice.getMemoryStats
[hello_world__memory] [STDERR] ===== asynchronous gap ===========================
[hello_world__memory] [STDERR] dart:async                                                 _asyncThenWrapperHelper
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/adb.dart 259:73        AndroidDevice.getMemoryStats
[hello_world__memory] [STDERR] package:flutter_devicelab/tasks/perf_tests.dart 261:59     MemoryTest.call.<fn>
[hello_world__memory] [STDERR] ===== asynchronous gap ===========================
[hello_world__memory] [STDERR] dart:async                                                 _asyncThenWrapperHelper
[hello_world__memory] [STDERR] package:flutter_devicelab/tasks/perf_tests.dart 234:48     MemoryTest.call.<fn>
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/utils.dart 282:24      inDirectory
[hello_world__memory] [STDERR] ===== asynchronous gap ===========================
[hello_world__memory] [STDERR] dart:async                                                 Future.Future.microtask
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/utils.dart 278:80      inDirectory
[hello_world__memory] [STDERR] package:flutter_devicelab/tasks/perf_tests.dart 234:12     MemoryTest.call
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/framework.dart 125:36  _TaskRunner._performTask.<fn>
[hello_world__memory] [STDERR] ===== asynchronous gap ===========================
[hello_world__memory] [STDERR] dart:async                                                 Future.Future.microtask
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/framework.dart 124:28  _TaskRunner._performTask.<fn>
[hello_world__memory] [STDERR] package:stack_trace                                        Chain.capture
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/framework.dart 124:11  _TaskRunner._performTask
[hello_world__memory] [STDERR] package:flutter_devicelab/framework/framework.dart 84:39   _TaskRunner.run
[hello_world__memory] [STDERR]
Task result:
{
  "success": false,
  "reason": "Task failed: NoSuchMethodError: The method 'group' was called on null.\nReceiver: null\nTried calling: group(1)"
}

••• Finished task "hello_world__memory" •••

Flutter Doctor

[✓] Flutter (on Mac OS X 10.12.4 16E195, channel master)
    • Flutter at /Users/cbracken/src/flutter/flutter
    • Framework revision ffa8483f3b (27 minutes ago), 2017-05-01 14:18:00 -0700
    • Engine revision da8ebf40bd
    • Tools Dart version 1.23.0-dev.11.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: tests"flutter test", flutter_test, or one of our testsplatform-androidAndroid applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions