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

Commit de28706d authored by Muhammad Qureshi's avatar Muhammad Qureshi
Browse files

Fix testValueMetric flake

Don't skip buckets with MULTIPLE_SKIPPED_BUCKETS reason for pushed
metric that is not diffed.

Fixes: 156690892
Test: atest --rerun-until-failure=100
CtsStatsdHostTestCases: android.cts.statsd.metric.ValueMetricsTests#testValueMetriccts.statsd.metric.ValueMetricsTests#testValueMetric
Change-Id: Ic14198d38ab63d99700a4df9e9e7ae04181f5139
parent a7642cd3
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -959,7 +959,10 @@ void ValueMetricProducer::flushCurrentBucketLocked(const int64_t& eventTimeNs,
    int64_t fullBucketEndTimeNs = getCurrentBucketEndTimeNs();
    int64_t bucketEndTime = fullBucketEndTimeNs;
    int64_t numBucketsForward = calcBucketsForwardCount(eventTimeNs);
    if (numBucketsForward > 1) {

    // Skip buckets if this is a pulled metric or a pushed metric that is diffed.
    if (numBucketsForward > 1 && (mIsPulled || mUseDiff)) {

        VLOG("Skipping forward %lld buckets", (long long)numBucketsForward);
        StatsdStats::getInstance().noteSkippedForwardBuckets(mMetricId);
        // Something went wrong. Maybe the device was sleeping for a long time. It is better