summaryrefslogtreecommitdiff
path: root/jstests/sharding/analyze_shard_key/configure_query_analyzer_persistence.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/sharding/analyze_shard_key/configure_query_analyzer_persistence.js')
-rw-r--r--jstests/sharding/analyze_shard_key/configure_query_analyzer_persistence.js13
1 files changed, 6 insertions, 7 deletions
diff --git a/jstests/sharding/analyze_shard_key/configure_query_analyzer_persistence.js b/jstests/sharding/analyze_shard_key/configure_query_analyzer_persistence.js
index 6ba1108021a..aba1408b8d1 100644
--- a/jstests/sharding/analyze_shard_key/configure_query_analyzer_persistence.js
+++ b/jstests/sharding/analyze_shard_key/configure_query_analyzer_persistence.js
@@ -73,10 +73,10 @@ function testPersistingConfiguration(conn) {
tojson({dbName, collName, collUuid})}`);
// Run a configureQueryAnalyzer command to disable query sampling. Verify that the command
- // fails since query sampling is not even active.
+ // does not fail although query sampling is not even active.
const mode0 = "off";
- assert.commandFailedWithCode(conn.adminCommand({configureQueryAnalyzer: ns, mode: mode0}),
- ErrorCodes.IllegalOperation);
+ const res0 = assert.commandWorked(conn.adminCommand({configureQueryAnalyzer: ns, mode: mode0}));
+ assertConfigQueryAnalyzerResponse(res0, {mode: mode0} /* newConfig */);
assertNoQueryAnalyzerConfigDoc(conn, ns);
// Run a configureQueryAnalyzer command to enable query sampling.
@@ -151,10 +151,9 @@ function testPersistingConfiguration(conn) {
{mode: mode6} /* newConfig */,
{mode: mode5, sampleRate: sampleRate5} /* oldConfig */);
- // Retry the previous configureQueryAnalyzer command. Verify that the 'stopTime' remains the
- // same.
- assert.commandFailedWithCode(conn.adminCommand({configureQueryAnalyzer: ns, mode: mode6}),
- ErrorCodes.IllegalOperation);
+ // Retry the previous configureQueryAnalyzer command. Verify that the retry does not fail and
+ // that the 'stopTime' remains the same.
+ assert.commandWorked(conn.adminCommand({configureQueryAnalyzer: ns, mode: mode6}));
assertQueryAnalyzerConfigDoc(
conn, ns, collUuid, mode6, sampleRate5, doc5.startTime, doc6.stopTime);
}