android_packages_modules_Co.../tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Aaron Huang a3debae1eb Move battery unplug command to the beginning of the test
The test failed because the test generated traffic
before the unplug command really done.

The unplug command will eventually have onBattery changed
to true. If the traffic is generated before onBattery changed
to true, then the cellular stats won't be updated. And then,
when BatteryStatsService schedules a sync task to update the
stats which will get no delta because the stats on cellular
has already added to mLastModemNetworkStats. Thus, the test
will finally get failed.

Currently, the battery unplug command is executed after connecting
to cellular network and making sure wifi is disconnected which may
trigger battery stats service schedules sync tasks. If there are
too many tasks need to run, then change onBattery to true would
be later. Thus, move the unplug command to the beginning of the
test and add "dumpsys batterystats --write" which will wait for the
worker to finish the task before continuing. Thus, it can make sure
the batterystats are synced.

Also, the stats will be reset when the devices are unplugging after
the battery was last full or the level is 100, or have gone through
a significant charge. So, enable no-auto-reset to avoid the stats
getting reset during the test.

Bug: 192808200
Test: atest CtsNetTestCases:BatteryStatsManagerTest
Change-Id: I08b38d9955c8cbb2d680e268c29368a4c0a7d144
2021-07-21 02:14:03 +08:00
..
common Use TRANSPORT_USB from the SDK 2021-07-14 16:35:11 +09:00
CoreTests/android/core Add support for custom TXT records in NSD 2014-04-14 14:10:36 -07:00
cts Move battery unplug command to the beginning of the test 2021-07-21 02:14:03 +08:00
deflake Merge history of packages/Connectivity 2021-05-24 05:45:18 +00:00
integration Jarjar all classes in service-connectivity 2021-07-12 19:33:33 +09:00
smoketest Merge history of packages/Connectivity 2021-05-24 05:45:18 +00:00
unit Merge "Fix a flake with mocking." 2021-07-19 12:16:18 +00:00
TEST_MAPPING Move net unit tests to packages/Connectivity 2021-05-13 08:30:33 +00:00