Fix flakiness in testDangerousPermissionStateSampled.
We failed to clear up data when going for retry if
no entries were sampled in the test. Number of tests where retries
are needed increased when we dropped the sampling rate in pull atom.
It exposed bug and made test flaky.
Fix: 150683344
Test: atest UidAtomTests#testDangerousPermissionStateSampled
Change-Id: I9e7edbc9d1fea3ac49b001b1f3bafb1fd48013e6
diff --git a/hostsidetests/statsd/src/android/cts/statsd/atom/UidAtomTests.java b/hostsidetests/statsd/src/android/cts/statsd/atom/UidAtomTests.java
index 2784b6a..8484269 100644
--- a/hostsidetests/statsd/src/android/cts/statsd/atom/UidAtomTests.java
+++ b/hostsidetests/statsd/src/android/cts/statsd/atom/UidAtomTests.java
@@ -1503,6 +1503,7 @@
break;
}
removeConfig(CONFIG_ID);
+ getReportList(); // Clears data.
}
assertThat(gaugeMetricDataList.size()).isGreaterThan(0);
assertThat(gaugeMetricDataList.size()).isLessThan(fullDangerousPermissionState.size());