diff --git a/gma/integration_test/src/integration_test.cc b/gma/integration_test/src/integration_test.cc index e7bc556ced..8b12ae74e3 100644 --- a/gma/integration_test/src/integration_test.cc +++ b/gma/integration_test/src/integration_test.cc @@ -2660,15 +2660,24 @@ TEST_F(FirebaseGmaUmpTest, TestUmpLoadForm) { EXPECT_EQ(consent_info_->GetConsentFormStatus(), firebase::gma::ump::kConsentFormStatusAvailable); - // Load the form. - firebase::Future future = consent_info_->LoadConsentForm(); + // Load the form. Run this step with retry in case of network timeout. + WaitForCompletionAnyResult( + RunWithRetry([&]() { return consent_info_->LoadConsentForm(); }), + "LoadConsentForm"); - EXPECT_TRUE(future == consent_info_->LoadConsentFormLastResult()); + firebase::Future future = consent_info_->LoadConsentFormLastResult(); - WaitForCompletion(future, "LoadConsentForm"); + // If it still timed out after all the retries, let the test pass. + EXPECT_THAT(future.error(), + AnyOf(firebase::gma::ump::kConsentFormSuccess, + firebase::gma::ump::kConsentFormErrorTimeout)); EXPECT_EQ(consent_info_->GetConsentFormStatus(), firebase::gma::ump::kConsentFormStatusAvailable); + + if (future.error() == firebase::gma::ump::kConsentFormErrorTimeout) { + LogWarning("Timed out after multiple tries, but passing anyway."); + } } TEST_F(FirebaseGmaUmpTest, TestUmpShowForm) {