Skip to content

Commit 376039b

Browse files
committed
update test
1 parent 88a99cc commit 376039b

File tree

2 files changed

+2
-35
lines changed

2 files changed

+2
-35
lines changed

firebase-perf/src/main/java/com/google/firebase/perf/session/gauges/GaugeManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,11 @@ public void onUpdateAppState(ApplicationProcessState applicationProcessState) {
108108

109109
// Log existing gauges to the current app state.
110110
logGaugeMetrics();
111+
111112
// Update App State.
112113
this.applicationProcessState = applicationProcessState;
113114

114-
// If it's a verbose session, start collecting gauges for the new app state.
115+
// Start collecting gauges for the new app state.
115116
startCollectingGauges(this.applicationProcessState, session.getTimer());
116117
}
117118

firebase-perf/src/test/java/com/google/firebase/perf/session/gauges/GaugeManagerTest.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
import java.util.Random;
4545
import java.util.concurrent.TimeUnit;
4646
import org.junit.Before;
47-
import org.junit.Ignore;
4847
import org.junit.Test;
4948
import org.junit.runner.RunWith;
5049
import org.mockito.ArgumentCaptor;
@@ -439,39 +438,6 @@ public void testStopCollectingGaugesCreatesOneLastJobToConsumeAnyPendingMetrics(
439438
testSessionId(1), recordedGaugeMetric, fakeMemoryMetricReading);
440439
}
441440

442-
@Test
443-
@Ignore // TODO(b/394127311): Update test for GaugeCounter.
444-
public void testGaugeManagerClearsTheQueueEachRun() {
445-
PerfSession fakeSession = createTestSession(1);
446-
447-
testGaugeManager.startCollectingGauges(fakeSession);
448-
449-
fakeCpuGaugeCollector.cpuMetricReadings.add(createFakeCpuMetricReading(200, 100));
450-
fakeCpuGaugeCollector.cpuMetricReadings.add(createFakeCpuMetricReading(300, 400));
451-
fakeMemoryGaugeCollector.memoryMetricReadings.add(
452-
createFakeAndroidMetricReading(/* currentUsedAppJavaHeapMemoryKb= */ 1234));
453-
454-
assertThat(fakeCpuGaugeCollector.cpuMetricReadings).isNotEmpty();
455-
assertThat(fakeMemoryGaugeCollector.memoryMetricReadings).isNotEmpty();
456-
457-
fakeScheduledExecutorService.simulateSleepExecutingAtMostOneTask();
458-
assertThat(fakeCpuGaugeCollector.cpuMetricReadings).isEmpty();
459-
assertThat(fakeMemoryGaugeCollector.memoryMetricReadings).isEmpty();
460-
461-
fakeCpuGaugeCollector.cpuMetricReadings.add(createFakeCpuMetricReading(200, 100));
462-
fakeMemoryGaugeCollector.memoryMetricReadings.add(
463-
createFakeAndroidMetricReading(/* currentUsedAppJavaHeapMemoryKb= */ 1234));
464-
fakeMemoryGaugeCollector.memoryMetricReadings.add(
465-
createFakeAndroidMetricReading(/* currentUsedAppJavaHeapMemoryKb= */ 2345));
466-
467-
assertThat(fakeCpuGaugeCollector.cpuMetricReadings).isNotEmpty();
468-
assertThat(fakeMemoryGaugeCollector.memoryMetricReadings).isNotEmpty();
469-
470-
fakeScheduledExecutorService.simulateSleepExecutingAtMostOneTask();
471-
assertThat(fakeCpuGaugeCollector.cpuMetricReadings).isEmpty();
472-
assertThat(fakeMemoryGaugeCollector.memoryMetricReadings).isEmpty();
473-
}
474-
475441
@Test
476442
public void testLogGaugeMetadataSendDataToTransport() {
477443
when(fakeGaugeMetadataManager.getDeviceRamSizeKb()).thenReturn(2000);

0 commit comments

Comments
 (0)