summaryrefslogtreecommitdiff
path: root/jstests/serverless/change_stream_state_commands.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/serverless/change_stream_state_commands.js')
-rw-r--r--jstests/serverless/change_stream_state_commands.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/jstests/serverless/change_stream_state_commands.js b/jstests/serverless/change_stream_state_commands.js
index c7196e7a104..f6fdcb6eb61 100644
--- a/jstests/serverless/change_stream_state_commands.js
+++ b/jstests/serverless/change_stream_state_commands.js
@@ -9,6 +9,10 @@
load("jstests/libs/fail_point_util.js"); // For configureFailPoint.
load('jstests/libs/parallel_shell_helpers.js'); // For funWithArgs.
+// Disable implicit sessions since dropping "config" database for a tenant must be done not in a
+// session.
+TestData.disableImplicitSessions = true;
+
const replSetTest =
new ReplSetTest({nodes: 2, name: "change-stream-state-commands", serverless: true});
@@ -104,6 +108,12 @@ const secondOrgTenantId = ObjectId();
setChangeStreamState(firstOrgTenantId, false);
setChangeStreamState(firstOrgTenantId, false);
assertChangeStreamState(firstOrgTenantId, false);
+
+ // Verify that dropping "config" database works and effectively disables change streams.
+ setChangeStreamState(firstOrgTenantId, true);
+ assert.commandWorked(replSetTest.getPrimary().getDB("config").runCommand(
+ {dropDatabase: 1, $tenant: firstOrgTenantId}));
+ assertChangeStreamState(firstOrgTenantId, false);
})();
// Tests that the 'setChangeStreamState' command tolerates the primary step-down and can
@@ -302,4 +312,5 @@ const secondOrgTenantId = ObjectId();
})();
replSetTest.stopSet();
+TestData.disableImplicitSessions = false;
}());