Skip to content

Commit 1dbc82a

Browse files
committed
update unit test
1 parent 64f9757 commit 1dbc82a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,16 @@ public void testGaugeCounterStartsAJobToConsumeTheGeneratedMetrics() {
344344
.isEqualTo(TIME_TO_WAIT_BEFORE_FLUSHING_GAUGES_QUEUE_MS);
345345

346346
fakeScheduledExecutorService.simulateSleepExecutingAtMostOneTask();
347+
348+
// Generate additional metrics, but doesn't start logging them as it hasn't met the threshold.
349+
generateMetricsAndIncrementCounter(5);
350+
assertThat(fakeScheduledExecutorService.isEmpty()).isTrue();
351+
347352
GaugeMetric recordedGaugeMetric =
348353
getLastRecordedGaugeMetric(ApplicationProcessState.FOREGROUND, 1);
349354

350-
// It flushes all metrics in the ConcurrentLinkedQueues.
355+
// It flushes all the original metrics in the ConcurrentLinkedQueues, but not the new ones
356+
// added after the task completed.
351357
int recordedGaugeMetricsCount =
352358
recordedGaugeMetric.getAndroidMemoryReadingsCount()
353359
+ recordedGaugeMetric.getCpuMetricReadingsCount();

0 commit comments

Comments
 (0)