Skip to content

Commit

Permalink
Merge branch 'fix-more-flakes' of https://github.com/firebase/firebas…
Browse files Browse the repository at this point in the history
…e-cpp-sdk into fix-more-flakes
  • Loading branch information
jonsimantov committed Jan 22, 2024
2 parents aeb22f4 + af589ca commit 56dc5e2
Show file tree
Hide file tree
Showing 18 changed files with 158 additions and 105 deletions.
2 changes: 1 addition & 1 deletion Android/firebase_dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ project.afterEvaluate {

// Add the bill-of-materials
project.dependencies {
implementation platform('com.google.firebase:firebase-bom:32.7.0')
implementation platform('com.google.firebase:firebase-bom:32.7.1')
}
for (String lib : firebaseCpp.dependencies.libSet) {
// Generate and include the proguard file
Expand Down
2 changes: 1 addition & 1 deletion app/app_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:32.7.0')
implementation platform('com.google.firebase:firebase-bom:32.7.1')
implementation 'com.google.firebase:firebase-analytics'
}

Expand Down
2 changes: 1 addition & 1 deletion app/google_api_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:32.7.0')
implementation platform('com.google.firebase:firebase-bom:32.7.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.android.gms:play-services-base:18.3.0'
implementation project(':app:app_resources')
Expand Down
2 changes: 1 addition & 1 deletion app/invites_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:32.7.0')
implementation platform('com.google.firebase:firebase-bom:32.7.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-dynamic-links'
implementation project(':app:app_resources')
Expand Down
2 changes: 1 addition & 1 deletion app_check/app_check_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:32.7.0')
implementation platform('com.google.firebase:firebase-bom:32.7.1')
implementation 'com.google.firebase:firebase-appcheck'
}

Expand Down
2 changes: 1 addition & 1 deletion auth/auth_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:32.7.0')
implementation platform('com.google.firebase:firebase-bom:32.7.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-auth'
implementation project(':app:app_resources')
Expand Down
6 changes: 3 additions & 3 deletions cpp_sdk_version.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"released": "11.7.0",
"stable": "11.7.0",
"head": "11.7.0"
"released": "11.8.0",
"stable": "11.8.0",
"head": "11.8.0"
}
2 changes: 1 addition & 1 deletion database/database_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:32.7.0')
implementation platform('com.google.firebase:firebase-bom:32.7.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-database'
//implementation project(':app:app_resources')
Expand Down
2 changes: 1 addition & 1 deletion firestore/firestore_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:32.7.0')
implementation platform('com.google.firebase:firebase-bom:32.7.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-firestore'
}
Expand Down
2 changes: 1 addition & 1 deletion gma/gma_resources/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ android {
}

dependencies {
implementation platform('com.google.firebase:firebase-bom:32.7.0')
implementation platform('com.google.firebase:firebase-bom:32.7.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.android.gms:play-services-ads:22.6.0'
implementation 'com.google.android.ump:user-messaging-platform:2.1.0'
Expand Down
113 changes: 96 additions & 17 deletions gma/integration_test/src/integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2599,6 +2599,8 @@ TEST_F(FirebaseGmaUmpTest, TestUmpRequestConsentInfoUpdate) {
using firebase::gma::ump::ConsentRequestParameters;
using firebase::gma::ump::ConsentStatus;

FLAKY_TEST_SECTION_BEGIN();

ConsentRequestParameters params;
params.tag_for_under_age_of_consent = false;

Expand All @@ -2607,7 +2609,13 @@ TEST_F(FirebaseGmaUmpTest, TestUmpRequestConsentInfoUpdate) {

EXPECT_TRUE(future == consent_info_->RequestConsentInfoUpdateLastResult());

WaitForCompletion(future, "RequestConsentInfoUpdate");
WaitForCompletion(future, "RequestConsentInfoUpdate",
{firebase::gma::ump::kConsentRequestSuccess,
firebase::gma::ump::kConsentRequestErrorNetwork});
// Retry only network errors.
EXPECT_NE(future.error(), firebase::gma::ump::kConsentRequestErrorNetwork);

FLAKY_TEST_SECTION_END();

EXPECT_NE(consent_info_->GetConsentStatus(),
firebase::gma::ump::kConsentStatusUnknown);
Expand All @@ -2622,6 +2630,8 @@ TEST_F(FirebaseGmaUmpTest, TestUmpRequestConsentInfoUpdateDebugEEA) {
using firebase::gma::ump::ConsentRequestParameters;
using firebase::gma::ump::ConsentStatus;

FLAKY_TEST_SECTION_BEGIN();

ConsentRequestParameters params;
params.tag_for_under_age_of_consent = false;
params.debug_settings.debug_geography =
Expand All @@ -2632,7 +2642,13 @@ TEST_F(FirebaseGmaUmpTest, TestUmpRequestConsentInfoUpdateDebugEEA) {
firebase::Future<void> future =
consent_info_->RequestConsentInfoUpdate(params);

WaitForCompletion(future, "RequestConsentInfoUpdate");
WaitForCompletion(future, "RequestConsentInfoUpdate",
{firebase::gma::ump::kConsentRequestSuccess,
firebase::gma::ump::kConsentRequestErrorNetwork});
// Retry only network errors.
EXPECT_NE(future.error(), firebase::gma::ump::kConsentRequestErrorNetwork);

FLAKY_TEST_SECTION_END();

EXPECT_EQ(consent_info_->GetConsentStatus(),
firebase::gma::ump::kConsentStatusRequired);
Expand All @@ -2643,6 +2659,8 @@ TEST_F(FirebaseGmaUmpTest, TestUmpRequestConsentInfoUpdateDebugNonEEA) {
using firebase::gma::ump::ConsentRequestParameters;
using firebase::gma::ump::ConsentStatus;

FLAKY_TEST_SECTION_BEGIN();

ConsentRequestParameters params;
params.tag_for_under_age_of_consent = false;
params.debug_settings.debug_geography =
Expand All @@ -2653,7 +2671,13 @@ TEST_F(FirebaseGmaUmpTest, TestUmpRequestConsentInfoUpdateDebugNonEEA) {
firebase::Future<void> future =
consent_info_->RequestConsentInfoUpdate(params);

WaitForCompletion(future, "RequestConsentInfoUpdate");
WaitForCompletion(future, "RequestConsentInfoUpdate",
{firebase::gma::ump::kConsentRequestSuccess,
firebase::gma::ump::kConsentRequestErrorNetwork});
// Retry only network errors.
EXPECT_NE(future.error(), firebase::gma::ump::kConsentRequestErrorNetwork);

FLAKY_TEST_SECTION_END();

EXPECT_THAT(consent_info_->GetConsentStatus(),
AnyOf(Eq(firebase::gma::ump::kConsentStatusNotRequired),
Expand Down Expand Up @@ -2747,15 +2771,25 @@ TEST_F(FirebaseGmaUmpTest, TestUmpLoadFormUnderAgeOfConsent) {
using firebase::gma::ump::ConsentRequestParameters;
using firebase::gma::ump::ConsentStatus;

FLAKY_TEST_SECTION_BEGIN();

ConsentRequestParameters params;
params.tag_for_under_age_of_consent = true;
params.debug_settings.debug_geography =
firebase::gma::ump::kConsentDebugGeographyEEA;
params.debug_settings.debug_device_ids = kTestDeviceIDs;
params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId());

WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params),
"RequestConsentInfoUpdate");
firebase::Future<void> future =
consent_info_->RequestConsentInfoUpdate(params);

WaitForCompletion(future, "RequestConsentInfoUpdate",
{firebase::gma::ump::kConsentRequestSuccess,
firebase::gma::ump::kConsentRequestErrorNetwork});
// Retry only network errors.
EXPECT_NE(future.error(), firebase::gma::ump::kConsentRequestErrorNetwork);

FLAKY_TEST_SECTION_END();

firebase::Future<void> load_future = consent_info_->LoadConsentForm();
WaitForCompletion(load_future, "LoadConsentForm",
Expand All @@ -2770,15 +2804,25 @@ TEST_F(FirebaseGmaUmpTest, TestUmpLoadFormUnavailableDebugNonEEA) {
using firebase::gma::ump::ConsentRequestParameters;
using firebase::gma::ump::ConsentStatus;

FLAKY_TEST_SECTION_BEGIN();

ConsentRequestParameters params;
params.tag_for_under_age_of_consent = false;
params.debug_settings.debug_geography =
firebase::gma::ump::kConsentDebugGeographyNonEEA;
params.debug_settings.debug_device_ids = kTestDeviceIDs;
params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId());

WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params),
"RequestConsentInfoUpdate");
firebase::Future<void> future =
consent_info_->RequestConsentInfoUpdate(params);

WaitForCompletion(future, "RequestConsentInfoUpdate",
{firebase::gma::ump::kConsentRequestSuccess,
firebase::gma::ump::kConsentRequestErrorNetwork});
// Retry only network errors.
EXPECT_NE(future.error(), firebase::gma::ump::kConsentRequestErrorNetwork);

FLAKY_TEST_SECTION_END();

if (consent_info_->GetConsentStatus() !=
firebase::gma::ump::kConsentStatusRequired) {
Expand All @@ -2792,15 +2836,25 @@ TEST_F(FirebaseGmaUmpTest, TestUmpLoadAndShowIfRequiredDebugNonEEA) {
using firebase::gma::ump::ConsentRequestParameters;
using firebase::gma::ump::ConsentStatus;

FLAKY_TEST_SECTION_BEGIN();

ConsentRequestParameters params;
params.tag_for_under_age_of_consent = false;
params.debug_settings.debug_geography =
firebase::gma::ump::kConsentDebugGeographyNonEEA;
params.debug_settings.debug_device_ids = kTestDeviceIDs;
params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId());

WaitForCompletion(consent_info_->RequestConsentInfoUpdate(params),
"RequestConsentInfoUpdate");
firebase::Future<void> future =
consent_info_->RequestConsentInfoUpdate(params);

WaitForCompletion(future, "RequestConsentInfoUpdate",
{firebase::gma::ump::kConsentRequestSuccess,
firebase::gma::ump::kConsentRequestErrorNetwork});
// Retry only network errors.
EXPECT_NE(future.error(), firebase::gma::ump::kConsentRequestErrorNetwork);

FLAKY_TEST_SECTION_END();

EXPECT_THAT(consent_info_->GetConsentStatus(),
AnyOf(Eq(firebase::gma::ump::kConsentStatusNotRequired),
Expand Down Expand Up @@ -3024,7 +3078,7 @@ TEST_F(FirebaseGmaUmpTest, TestUmpCleanupRaceCondition) {
ProcessEvents(5000);
}

TEST_F(FirebaseGmaUmpTest, TestUmpCallbacksOnWrongInstance_DISABLED) {
TEST_F(FirebaseGmaUmpTest, TestUmpCallbacksOnWrongInstance) {
// Ensure that if ConsentInfo is deleted and then recreated, stale
// callbacks don't call into the new instance and cause crashes.
using firebase::gma::ump::ConsentFormStatus;
Expand All @@ -3038,23 +3092,46 @@ TEST_F(FirebaseGmaUmpTest, TestUmpCallbacksOnWrongInstance_DISABLED) {
params.debug_settings.debug_device_ids = kTestDeviceIDs;
params.debug_settings.debug_device_ids.push_back(GetDebugDeviceId());

consent_info_->RequestConsentInfoUpdate(params);
consent_info_->LoadConsentForm();
LogDebug("RequestConsentInfoUpdate");
consent_info_->RequestConsentInfoUpdate(params).OnCompletion(
[](const firebase::Future<void>&) {
LogDebug("RequestConsentInfoUpdate done");
});
LogDebug("LoadConsentForm");
consent_info_->LoadConsentForm().OnCompletion(
[](const firebase::Future<void>&) { LogDebug("LoadConsentForm done"); });
// In automated tests, only check RequestConsentInfoUpdate and LoadConsentForm
// as the rest may show UI.
if (ShouldRunUITests()) {
consent_info_->ShowConsentForm(app_framework::GetWindowController());
consent_info_->LoadAndShowConsentFormIfRequired(
app_framework::GetWindowController());
consent_info_->ShowPrivacyOptionsForm(app_framework::GetWindowController());
LogDebug("ShowConsentForm");
consent_info_->ShowConsentForm(app_framework::GetWindowController())
.OnCompletion([](const firebase::Future<void>&) {
LogDebug("ShowConsentForm done");
});
LogDebug("LoadAndShowConsentFormIfRequired");
consent_info_
->LoadAndShowConsentFormIfRequired(app_framework::GetWindowController())
.OnCompletion([](const firebase::Future<void>&) {
LogDebug("LoadAndShowConsentFormIfRequired done");
});
LogDebug("ShowPrivacyOptionsForm");
consent_info_->ShowPrivacyOptionsForm(app_framework::GetWindowController())
.OnCompletion([](const firebase::Future<void>&) {
LogDebug("ShowPrivacyOptionsForm done");
});
}

LogDebug("Terminate");
TerminateUmp(kNoReset);

LogDebug("Initialize");
InitializeUmp(kNoReset);

// Give the operations time to complete.
LogDebug("Wait");
ProcessEvents(5000);

LogDebug("Done");
}

TEST_F(FirebaseGmaUmpTest, TestUmpMethodsReturnOperationInProgress) {
Expand Down Expand Up @@ -3086,7 +3163,9 @@ TEST_F(FirebaseGmaUmpTest, TestUmpMethodsReturnOperationInProgress) {
WaitForCompletion(
future_request_2, "RequestConsentInfoUpdate second",
firebase::gma::ump::kConsentRequestErrorOperationInProgress);
WaitForCompletion(future_request_1, "RequestConsentInfoUpdate first");
WaitForCompletion(future_request_1, "RequestConsentInfoUpdate first",
{firebase::gma::ump::kConsentRequestSuccess,
firebase::gma::ump::kConsentRequestErrorNetwork});

consent_info_->Reset();

Expand Down
Loading

0 comments on commit 56dc5e2

Please sign in to comment.