From 5b41c0391379b3d71954a345630a684177fbf4fb Mon Sep 17 00:00:00 2001 From: Benety Goh Date: Tue, 27 Feb 2024 11:31:56 -0500 Subject: [PATCH] SERVER-86630 inject failure into listCollections Repro command line for resmoke.py: buildscripts/resmoke.py run --runAllFeatureFlagTests --suite=secondary_reads_passthrough_with_replica_set_endpoint jstests/core/covered_query_with_sort.js --- src/mongo/db/commands/list_collections.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mongo/db/commands/list_collections.cpp b/src/mongo/db/commands/list_collections.cpp index b5459b9003a..ad8ebd30d59 100644 --- a/src/mongo/db/commands/list_collections.cpp +++ b/src/mongo/db/commands/list_collections.cpp @@ -369,6 +369,14 @@ public: MatchExpressionParser::parse(*listCollRequest.getFilter(), expCtx)); } + if (dbName == DatabaseName::createDatabaseName_forTest(boost::none, "config")) { + static int configCount = 0; + LOGV2(0, "XXXXXXXX LIST COLLECTIONS CONFIG DB", "count"_attr = configCount); + configCount++; + uassert(ErrorCodes::ObjectIsBusy, + "Injected listCollections failure on config db", + configCount != 3); + } // Check for 'includePendingDrops' flag. The default is to not include drop-pending // collections. bool includePendingDrops = listCollRequest.getIncludePendingDrops().value_or(false); -- 2.39.3 (Apple Git-145)