Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 3ce441f6 authored by Tej Singh's avatar Tej Singh
Browse files

Statsd unit tests: clear data on disk after tests

A couple of tests had data stored to disk, but were not reading the
data. This meant that the data would persist across tests (and between
tests runs and forever). This causes issues when conbined with the fact
that in tests, we use ConfigKey without initializing it. This means that
the uid/id of the config key will just be set to some random stack
space. In Christine's case, adding State to the StatsdConfig.proto
caused the "random" stack space to be the same as the one in
ConfigTttl_e2e_test, which also wrote data to disk. Then, when the
duration metric test called onDumpReport, it would grab the data on disk
(from ConfigTtl, which used a count metric), in addition to the actual
data we cared about, Adding the logic to convert the output to base64
string likely changed which stack space was allocated, meaning the
config ttl data would not be pulled, thereby destroying our debugging
efforts.

Test: unit tests pass, nothing is written to /data/misc/stats-data after
running unit tests.
Test: unit tests pass with Christine's proto change to add State to
StatsdConfig

Change-Id: Ica987b7a1c089dae6c45d0500bf6557fa7402191
parent 4e13461e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment