Repository navigation
Check for Android package before running memory tests #9706
Copy link
Copy link
Closed
Labels
a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsplatform-androidAndroid applications specificallyAndroid applications specifically
Description
Steps to Reproduce
- In
dev/devicelab/lib/tasks/perf_tests.dart, change the package of thehello_worldtest to something else (e.g.,io.flutter.broken.hello_world). - 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: tests"flutter test", flutter_test, or one of our tests"flutter test", flutter_test, or one of our testsplatform-androidAndroid applications specificallyAndroid applications specifically
Activity
MeGaPk commentedon Feb 22, 2018
same problem in ios. I just create new project via Intellij idea and.... same error. Tried on iOS simulator
UPDATED:
Oh, that error mean, "before use, run your ios app first time via xcode".
mxcl commentedon Mar 8, 2018
I did this but still get this error.
mxcl commentedon Mar 9, 2018
K turned out this happens if your simulator is from an Xcode beta. Google need to make their regex for checking SDK major version less flakey.
cbracken commentedon Mar 13, 2018
@mxcl can you provide a little more detail? I'm not able to reproduce this issue with Xcode 9.3 beta 4.
Specifically the output of the following commands would be useful to help understand what's going on:
flutter doctor -vxcode-select -pflutter run -v -d "iPhone X"kiriny commentedon Mar 22, 2018
flutter doctor -v
xcode-select -p
/Applications/Xcode.app/Contents/Developerflutter run -v -d "iPhone X"
cbracken commentedon Mar 22, 2018
@kiriny in your case it looks like you're running from a directory that does not include a pubspec.yaml file. This doesn't appear related, but I suspect you should be good to go if you run from your project directory.
cbracken commentedon Mar 22, 2018
@MeGaPk @mxcl your issue should be resolved by #15628.
cbracken commentedon Mar 22, 2018
/cc @yjbanov (in case you can think of an obvious and quick fix/check we could do here)
Note: the original bug is specific to running our internal Flutter performance tests on Android devices/emulators, specifically related to us providing better detection when the test contains a bug specifying the wrong Android package.
Closing since this is really meant to catch what should be an incredibly rare source of user error in local runs of our devicelab tests, and should really only affect developers working on Flutter itself.
github-actions commentedon Aug 8, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.