Skip to content

Commit

Permalink
Fix retry.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonsimantov committed Oct 19, 2023
1 parent e4c8b83 commit b59a386
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions gma/integration_test/src/integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2662,20 +2662,18 @@ TEST_F(FirebaseGmaUmpTest, TestUmpLoadForm) {
firebase::gma::ump::kConsentFormStatusAvailable);

// Load the form. Run this step with retry in case of network timeout.
WaitForCompletion(
RunWithRetry([&]() { return consent_info_->LoadConsentForm(); },
"LoadConsentForm",
firebase::gma::ump::kConsentFormErrorTimeout),
"LoadConsentForm");
WaitForCompletionAnyResult(RunWithRetry([&]() { return consent_info_->LoadConsentForm(); }),
"LoadConsentForm");

firebase::Future<void> future = consent_info_->LoadConsentFormLastResult();

// If it still timed out after all the retries, let the test pass.
EXPECT_THAT(AnyOf(Eq(future.error(), firebase::gma::ump::kConsentFormSuccess),
Eq(future.error(), firebase::gma::ump::kConsentFormErrorTimeout)));
EXPECT_THAT(future.error(),
AnyOf(firebase::gma::ump::kConsentFormSuccess,
firebase::gma::ump::kConsentFormErrorTimeout));

EXPECT_EQ(consent_info_->GetConsentFormStatus(),
firebase::gma::ump::kConsentFormStatusAvailable);
firebase::gma::ump::kConsentFormStatusAvailable);

if (future.error() == firebase::gma::ump::kConsentFormErrorTimeout) {
LogWarning("Timed out after multiple tries, but passing anyway.");
Expand Down

0 comments on commit b59a386

Please sign in to comment.