File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -2660,15 +2660,24 @@ TEST_F(FirebaseGmaUmpTest, TestUmpLoadForm) {
2660
2660
EXPECT_EQ (consent_info_->GetConsentFormStatus (),
2661
2661
firebase::gma::ump::kConsentFormStatusAvailable );
2662
2662
2663
- // Load the form.
2664
- firebase::Future<void > future = consent_info_->LoadConsentForm ();
2663
+ // Load the form. Run this step with retry in case of network timeout.
2664
+ WaitForCompletionAnyResult (
2665
+ RunWithRetry ([&]() { return consent_info_->LoadConsentForm (); }),
2666
+ " LoadConsentForm" );
2665
2667
2666
- EXPECT_TRUE ( future == consent_info_->LoadConsentFormLastResult () );
2668
+ firebase::Future< void > future = consent_info_->LoadConsentFormLastResult ();
2667
2669
2668
- WaitForCompletion (future, " LoadConsentForm" );
2670
+ // If it still timed out after all the retries, let the test pass.
2671
+ EXPECT_THAT (future.error (),
2672
+ AnyOf (firebase::gma::ump::kConsentFormSuccess ,
2673
+ firebase::gma::ump::kConsentFormErrorTimeout ));
2669
2674
2670
2675
EXPECT_EQ (consent_info_->GetConsentFormStatus (),
2671
2676
firebase::gma::ump::kConsentFormStatusAvailable );
2677
+
2678
+ if (future.error () == firebase::gma::ump::kConsentFormErrorTimeout ) {
2679
+ LogWarning (" Timed out after multiple tries, but passing anyway." );
2680
+ }
2672
2681
}
2673
2682
2674
2683
TEST_F (FirebaseGmaUmpTest, TestUmpShowForm) {
You can’t perform that action at this time.
0 commit comments