Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DiannaHohensee/206618a7a494657ac0948a343de3a139 to your computer and use it in GitHub Desktop.
Save DiannaHohensee/206618a7a494657ac0948a343de3a139 to your computer and use it in GitHub Desktop.
diff --git a/src/mongo/s/shard_server_test_fixture.cpp b/src/mongo/s/shard_server_test_fixture.cpp
index ec77c5a..63173e0 100644
--- a/src/mongo/s/shard_server_test_fixture.cpp
+++ b/src/mongo/s/shard_server_test_fixture.cpp
@@ -84,6 +84,9 @@ void ShardServerTestFixture::setUp() {
uassertStatusOK(
initializeGlobalShardingStateForMongodForTest(ConnectionString(kConfigHostAndPort)));
+ // Initialize the CatalogCache so that shard server metadata refreshes will work.
+ catalogCache()->initializeReplicaSetRole(true);
+
// Set the findHost() return value on the mock targeter so that later calls to the
// config targeter's findHost() return the appropriate value.
configTargeterMock()->setFindHostReturnValue(kConfigHostAndPort);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment