File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed
firebase-perf/src/test/java/com/google/firebase/perf/session/gauges Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change 2727import static org .mockito .Mockito .times ;
2828import static org .mockito .Mockito .verify ;
2929import static org .mockito .Mockito .when ;
30+ import static org .robolectric .Shadows .shadowOf ;
3031
32+ import android .os .Looper ;
3133import androidx .test .core .app .ApplicationProvider ;
3234import com .google .firebase .components .Lazy ;
3335import com .google .firebase .perf .FirebasePerformanceTestBase ;
@@ -344,6 +346,7 @@ public void testGaugeCounterStartsAJobToConsumeTheGeneratedMetrics() {
344346 .isEqualTo (TIME_TO_WAIT_BEFORE_FLUSHING_GAUGES_QUEUE_MS );
345347
346348 fakeScheduledExecutorService .simulateSleepExecutingAtMostOneTask ();
349+ shadowOf (Looper .getMainLooper ()).idle ();
347350
348351 // Generate additional metrics, but doesn't start logging them as it hasn't met the threshold.
349352 generateMetricsAndIncrementCounter (5 );
You can’t perform that action at this time.
0 commit comments