Skip to content

Commit

Permalink
Add a workaround for an AdMob race condition to integration test. (#263)
Browse files Browse the repository at this point in the history
The AdMob SDK crashes if you call Initialize and Terminate too quickly on a non-main thread. This happens in the integration test when skipping the interactive tests (e.g. when running on FTL).
  • Loading branch information
jonsimantov authored Jan 29, 2021
1 parent d5d1d1e commit 66be026
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions admob/integration_test/src/integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ void FirebaseAdMobTest::SetUpTestSuite() {
}

void FirebaseAdMobTest::TearDownTestSuite() {
// Workaround: AdMob does some of its initialization in the main
// thread, so if you terminate it too quickly after initialization
// it can cause issues. Add a small delay here in case most of the
// tests are skipped.
ProcessEvents(1000);
LogDebug("Shutdown AdMob.");
firebase::admob::Terminate();
LogDebug("Shutdown Firebase App.");
Expand Down

0 comments on commit 66be026

Please sign in to comment.