|
|
@@ -57,7 +57,12 @@ protected:
|
|
|
// Dropping each index before its collection is therefore the only way
|
|
|
// to reach a clean slate. The project name is fixed, so without this
|
|
|
// the suite is not idempotent.
|
|
|
- {
|
|
|
+ // Best-effort, and it has to be: on a database with no previous run
|
|
|
+ // there is no registry collection to read and listing it throws, which
|
|
|
+ // is every fresh container. Nothing here is required for correctness -
|
|
|
+ // it only removes state a previous run on a PERSISTENT database left
|
|
|
+ // behind - so a failure to find anything is the normal case.
|
|
|
+ try {
|
|
|
CollectionRegistry stale(*db_);
|
|
|
for (const auto& m : stale.list(project_)) {
|
|
|
const std::string qc = qualify(project_, m.name);
|
|
|
@@ -67,6 +72,8 @@ protected:
|
|
|
db_->client().dropCompositeUniqueIndex(qc, fields);
|
|
|
db_->client().dropCollection(qc);
|
|
|
}
|
|
|
+ } catch (const std::exception&) {
|
|
|
+ // No previous run to clean up.
|
|
|
}
|
|
|
db_->dropProject(project_);
|
|
|
db_->client().dropCollection(qualify(project_, "vectorapi_collections"));
|