Closed Bug 1425163 Opened 2 years ago Closed 2 years ago

devicemanagerADB getInfo('memtotal') fails on some devices (Android 7.0 emulator)


(Testing :: Mozbase, defect)

Not set


(firefox59 fixed)

Tracking Status
firefox59 --- fixed


(Reporter: gbrown, Assigned: gbrown)




(1 file)

With 'mach android-emulator --version 7.0', I find all tests fail on devicemanager's getInfo(). Apparently it fails to retrieve /proc/meminfo.

[task 2017-12-13T20:41:26.819Z] 20:41:26     INFO -  Device info:
[task 2017-12-13T20:41:28.117Z] 20:41:28     INFO -  Traceback (most recent call last):
[task 2017-12-13T20:41:28.117Z] 20:41:28     INFO -    File "/builds/worker/workspace/build/tests/mochitest/", line 400, in <module>
[task 2017-12-13T20:41:28.117Z] 20:41:28     INFO -      sys.exit(main())
[task 2017-12-13T20:41:28.117Z] 20:41:28     INFO -    File "/builds/worker/workspace/build/tests/mochitest/", line 396, in main
[task 2017-12-13T20:41:28.118Z] 20:41:28     INFO -      return run_test_harness(parser, options)
[task 2017-12-13T20:41:28.118Z] 20:41:28     INFO -    File "/builds/worker/workspace/build/tests/mochitest/", line 348, in run_test_harness
[task 2017-12-13T20:41:28.118Z] 20:41:28     INFO -      mochitest.printDeviceInfo()
[task 2017-12-13T20:41:28.119Z] 20:41:28     INFO -    File "/builds/worker/workspace/build/tests/mochitest/", line 254, in printDeviceInfo
[task 2017-12-13T20:41:28.119Z] 20:41:28     INFO -      devinfo = self._dm.getInfo()
[task 2017-12-13T20:41:28.119Z] 20:41:28     INFO -    File "/builds/worker/workspace/build/venv/lib/python2.7/site-packages/mozdevice/", line 650, in getInfo
[task 2017-12-13T20:41:28.119Z] 20:41:28     INFO -      ret["memtotal"] = meminfo["MemTotal"]
[task 2017-12-13T20:41:28.119Z] 20:41:28     INFO -  KeyError: 'MemTotal'
[task 2017-12-13T20:41:28.130Z] 20:41:28    ERROR - Return code: 1
[task 2017-12-13T20:41:28.130Z] 20:41:28    ERROR - No tests run or test summary not found
In local testing, I see:

gbrown@mozpad:~/src$ adb shell cat /proc/meminfo
MemTotal:        2059124 kB
MemFree:         1255312 kB
Buffers:            6884 kB
Cached:           520924 kB
SwapCached:            0 kB
Active:           303616 kB
Inactive:         440684 kB
Active(anon):     222952 kB
Inactive(anon):     1128 kB
Active(file):      80664 kB
Inactive(file):   439556 kB
Unevictable:         256 kB
Mlocked:             256 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:        216788 kB
Mapped:           244204 kB
Shmem:              7604 kB
Slab:              24604 kB
SReclaimable:       9956 kB
SUnreclaim:        14648 kB
KernelStack:        7696 kB
PageTables:        11280 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     1029560 kB
Committed_AS:   17600724 kB
VmallocTotal:   251658176 kB
VmallocUsed:       36340 kB
VmallocChunk:   251611588 kB

gbrown@mozpad:~/src$ adb pull /proc/meminfo xx
adb: error: remote object '/proc/meminfo' does not exist
The core of this fix is switching from 'adb pull /proc/meminfo' to 'adb shell cat /proc/meminfo' to retrieve memory data. 

I've also tried to make this more tolerant to unexpected data formats (if MemTotal is not found or some line in meminfo is not in an expected format, I'd prefer to simply not return any memory info, rather than raising an error and breaking tests).
Attachment #8936727 - Flags: review?(bob)
Comment on attachment 8936727 [details] [diff] [review]
use 'cat /proc/meminfo'

Review of attachment 8936727 [details] [diff] [review]:

lgtm. r+
Attachment #8936727 - Flags: review?(bob) → review+
Pushed by
Use cat /proc/meminfo rather than trying to pull it from device; r=bc
Blocks: 1425322
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.