Skip to content

Commit 66be026

Browse files
authored
Add a workaround for an AdMob race condition to integration test. (#263)
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).
1 parent d5d1d1e commit 66be026

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

admob/integration_test/src/integration_test.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ void FirebaseAdMobTest::SetUpTestSuite() {
123123
}
124124

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

0 commit comments

Comments
 (0)