Skip to content

Commit 32ee577

Browse files
Googlera-maurice
authored andcommitted
Remove the unconditional calls to Firebase::Terminate() in test cleanup.
These calls were present as a workaround for bugs in the Firestore destructor; however, since those bugs have been fixed the calls to Terminate() are now superfluous and, worse, can hide bugs. As a result, they are being removed. PiperOrigin-RevId: 320627333
1 parent feb21a7 commit 32ee577

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

firestore/src/tests/firestore_integration_test.cc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ FirestoreIntegrationTest::FirestoreIntegrationTest() {
6161

6262
FirestoreIntegrationTest::~FirestoreIntegrationTest() {
6363
for (auto named_firestore : firestores_) {
64-
Await(named_firestore.second->Terminate());
6564
Release(named_firestore.second);
6665
firestores_[named_firestore.first] = nullptr;
6766
}
@@ -108,7 +107,7 @@ void FirestoreIntegrationTest::DeleteFirestore(const std::string& name) {
108107
found != firestores_.end(),
109108
"Couldn't find Firestore corresponding to app name '%s'", name.c_str());
110109

111-
TerminateAndRelease(found->second);
110+
Release(found->second);
112111
firestores_.erase(found);
113112
}
114113

@@ -233,10 +232,5 @@ std::string FirestoreIntegrationTest::DescribeFailedFuture(
233232
std::to_string(future.error()) + ", message " + future.error_message();
234233
}
235234

236-
void FirestoreIntegrationTest::TerminateAndRelease(Firestore* firestore) {
237-
Await(firestore->Terminate());
238-
Release(firestore);
239-
}
240-
241235
} // namespace firestore
242236
} // namespace firebase

firestore/src/tests/firestore_integration_test.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,6 @@ class FirestoreIntegrationTest : public testing::Test {
274274
template <typename T>
275275
friend class EventAccumulator;
276276

277-
// Blocks until the given Firestore instance terminates, deletes the instance
278-
// and removes the pointer to it from the cache.
279-
void TerminateAndRelease(Firestore* firestore);
280-
281277
// The Firestore instance cache.
282278
mutable std::map<std::string, Firestore*> firestores_;
283279
};

0 commit comments

Comments
 (0)