@@ -130,7 +130,6 @@ public void setUp() {
130
130
@ After
131
131
public void tearDown () {
132
132
shadowOf (Looper .getMainLooper ()).idle ();
133
- GaugeCounter .INSTANCE .resetCounter ();
134
133
}
135
134
136
135
@ Test
@@ -332,11 +331,11 @@ public void stopCollectingGauges_invalidGaugeCollectionFrequency_appInForeground
332
331
}
333
332
334
333
@ Test
335
- public void testGaugeCounterStartsAJobToConsumeTheGeneratedMetrics () {
334
+ public void testGaugeCounterStartsAJobToConsumeTheGeneratedMetrics () throws InterruptedException {
336
335
PerfSession fakeSession = createTestSession (1 );
337
336
testGaugeManager .setApplicationProcessState (ApplicationProcessState .FOREGROUND );
338
337
testGaugeManager .startCollectingGauges (fakeSession );
339
- GaugeCounter .setGaugeManager (testGaugeManager );
338
+ GaugeCounter .INSTANCE . setGaugeManager (testGaugeManager );
340
339
341
340
// There's no job to log the gauges.
342
341
assertThat (fakeScheduledExecutorService .isEmpty ()).isTrue ();
@@ -378,7 +377,7 @@ public void testUpdateAppStateHandlesMultipleAppStates() {
378
377
fakeSession .setGaugeAndEventCollectionEnabled (true );
379
378
testGaugeManager .setApplicationProcessState (ApplicationProcessState .FOREGROUND );
380
379
testGaugeManager .startCollectingGauges (fakeSession );
381
- GaugeCounter .setGaugeManager (testGaugeManager );
380
+ GaugeCounter .INSTANCE . setGaugeManager (testGaugeManager );
382
381
383
382
// Generate metrics that don't exceed the GaugeCounter.MAX_COUNT.
384
383
generateMetricsAndIncrementCounter (10 );
@@ -430,7 +429,7 @@ public void testGaugeManagerHandlesMultipleSessionIds() {
430
429
fakeSession .setGaugeAndEventCollectionEnabled (true );
431
430
testGaugeManager .setApplicationProcessState (ApplicationProcessState .BACKGROUND );
432
431
testGaugeManager .startCollectingGauges (fakeSession );
433
- GaugeCounter .setGaugeManager (testGaugeManager );
432
+ GaugeCounter .INSTANCE . setGaugeManager (testGaugeManager );
434
433
435
434
// Generate metrics that don't exceed the GaugeCounter.MAX_COUNT.
436
435
generateMetricsAndIncrementCounter (10 );
@@ -520,7 +519,7 @@ public void testStopCollectingGaugesCreatesOneLastJobToConsumeAnyPendingMetrics(
520
519
+ recordedGaugeMetric .getCpuMetricReadingsCount ();
521
520
assertThat (recordedGaugeMetricsCount ).isEqualTo (2 );
522
521
523
- // TODO(b/394127311): Investigate why this isn't 0.
522
+ // TODO(b/394127311): Investigate why this isn't 0 on local runs .
524
523
// assertThat(GaugeCounter.INSTANCE.count()).isEqualTo(0);
525
524
}
526
525
0 commit comments