diff options
author | Esha Maharishi <esha.maharishi@mongodb.com> | 2016-08-01 13:56:09 -0400 |
---|---|---|
committer | Esha Maharishi <esha.maharishi@mongodb.com> | 2016-08-01 14:16:39 -0400 |
commit | bbf959a5d661d061d7564a4049633626f558da08 (patch) | |
tree | a1f5e0c9a4a809cadcc8bcf06180040d488fe265 | |
parent | 9f1b00d208424aa5c6dcf87778f31c9ace58cb0b (diff) | |
download | mongo-bbf959a5d661d061d7564a4049633626f558da08.tar.gz |
SERVER-25379 remove single document instead of dropping all dbs in config_server_catalog_test OnlyRunsOnce
-rw-r--r-- | src/mongo/s/catalog/replset/sharding_catalog_config_initialization_test.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/s/catalog/replset/sharding_catalog_config_initialization_test.cpp b/src/mongo/s/catalog/replset/sharding_catalog_config_initialization_test.cpp index b37c590a901..8d2b3595252 100644 --- a/src/mongo/s/catalog/replset/sharding_catalog_config_initialization_test.cpp +++ b/src/mongo/s/catalog/replset/sharding_catalog_config_initialization_test.cpp @@ -34,6 +34,7 @@ #include "mongo/bson/json.h" #include "mongo/db/namespace_string.h" #include "mongo/s/catalog/config_server_version.h" +#include "mongo/s/catalog/sharding_catalog_client.h" #include "mongo/s/catalog/sharding_catalog_manager.h" #include "mongo/s/catalog/type_chunk.h" #include "mongo/s/catalog/type_config_version.h" @@ -187,8 +188,11 @@ TEST_F(ConfigInitializationTest, OnlyRunsOnce) { ASSERT_EQUALS(CURRENT_CONFIG_VERSION, foundVersion.getCurrentVersion()); ASSERT_EQUALS(MIN_COMPATIBLE_CONFIG_VERSION, foundVersion.getMinCompatibleVersion()); - // Now drop all databases and re-run initializeConfigDatabaseIfNeeded() - _dropAllDBs(operationContext()); + // Now remove the version document and re-run initializeConfigDatabaseIfNeeded(). + ASSERT_OK(catalogClient()->removeConfigDocuments(operationContext(), + VersionType::ConfigNS, + BSONObj(), + ShardingCatalogClient::kMajorityWriteConcern)); ASSERT_EQUALS(ErrorCodes::AlreadyInitialized, catalogManager()->initializeConfigDatabaseIfNeeded(operationContext())); |