Skip to content

Commit 967dcad

Browse files
Attempt to fix flaky tests.
1 parent 4499947 commit 967dcad

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

firebase-perf/src/test/java/com/google/firebase/perf/FirebasePerformanceTest.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -545,14 +545,12 @@ private FirebasePerformance initializeFirebasePerformancePreferences(
545545
Boolean sharedPreferencesEnabledDisabledKey,
546546
Provider<RemoteConfigComponent> firebaseRemoteConfigProvider,
547547
Provider<TransportFactory> transportFactoryProvider) {
548+
DeviceCacheManager deviceCacheManager = new DeviceCacheManager(fakeDirectExecutorService);
549+
deviceCacheManager.setContext(ApplicationProvider.getApplicationContext());
548550
if (sharedPreferencesEnabledDisabledKey != null) {
549-
DeviceCacheManager deviceCacheManager = new DeviceCacheManager(fakeDirectExecutorService);
550-
deviceCacheManager.setContext(ApplicationProvider.getApplicationContext());
551551
deviceCacheManager.setValue(Constants.ENABLE_DISABLE, sharedPreferencesEnabledDisabledKey);
552-
} else {
553-
DeviceCacheManager deviceCacheManager = new DeviceCacheManager(fakeDirectExecutorService);
554-
deviceCacheManager.setContext(ApplicationProvider.getApplicationContext());
555552
}
553+
spyConfigResolver.setDeviceCacheManager(deviceCacheManager);
556554

557555
Bundle bundle = new Bundle();
558556
if (metadataFireperfEnabledKey != null) {

0 commit comments

Comments
 (0)