summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/telemetry/feature_flag_off_sampling_rate_on.js
diff options
context:
space:
mode:
authorWill Buerger <will.buerger@mongodb.com>2023-05-17 11:49:47 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-05-17 12:58:52 +0000
commitae65ecae5514adc99d60b7396137a1acf2b44335 (patch)
tree24169f9a640321bfbbec649e869fe51b273b35e3 /jstests/noPassthrough/telemetry/feature_flag_off_sampling_rate_on.js
parent1b4a551a6b8c85611e26857217ce1a1e1363e716 (diff)
downloadmongo-ae65ecae5514adc99d60b7396137a1acf2b44335.tar.gz
SERVER-76427 Rename $telemetry to $queryStats
Diffstat (limited to 'jstests/noPassthrough/telemetry/feature_flag_off_sampling_rate_on.js')
-rw-r--r--jstests/noPassthrough/telemetry/feature_flag_off_sampling_rate_on.js54
1 files changed, 0 insertions, 54 deletions
diff --git a/jstests/noPassthrough/telemetry/feature_flag_off_sampling_rate_on.js b/jstests/noPassthrough/telemetry/feature_flag_off_sampling_rate_on.js
deleted file mode 100644
index 7fbc079cc7b..00000000000
--- a/jstests/noPassthrough/telemetry/feature_flag_off_sampling_rate_on.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * Test that calls to read from telemetry store fail when feature flag is turned off and sampling
- * rate > 0.
- */
-load('jstests/libs/analyze_plan.js');
-load("jstests/libs/feature_flag_util.js");
-
-(function() {
-"use strict";
-
-// Set sampling rate to -1.
-let options = {
- setParameter: {internalQueryConfigureTelemetrySamplingRate: -1},
-};
-const conn = MongoRunner.runMongod(options);
-const testdb = conn.getDB('test');
-
-// This test specifically tests error handling when the feature flag is not on.
-// TODO SERVER-65800 This test can be deleted when the feature is on by default.
-if (!conn || FeatureFlagUtil.isEnabled(testdb, "Telemetry")) {
- jsTestLog(`Skipping test since feature flag is disabled. conn: ${conn}`);
- if (conn) {
- MongoRunner.stopMongod(conn);
- }
- return;
-}
-
-var coll = testdb[jsTestName()];
-coll.drop();
-
-// Bulk insert documents to reduces roundtrips and make timeout on a slow machine less likely.
-const bulk = coll.initializeUnorderedBulkOp();
-for (let i = 1; i <= 20; i++) {
- bulk.insert({foo: 0, bar: Math.floor(Math.random() * 3)});
-}
-assert.commandWorked(bulk.execute());
-
-// Pipeline to read telemetry store should fail without feature flag turned on even though sampling
-// rate is > 0.
-assert.commandFailedWithCode(
- testdb.adminCommand({aggregate: 1, pipeline: [{$telemetry: {}}], cursor: {}}),
- ErrorCodes.QueryFeatureNotAllowed);
-
-// Pipeline, with a filter, to read telemetry store fails without feature flag turned on even though
-// sampling rate is > 0.
-assert.commandFailedWithCode(testdb.adminCommand({
- aggregate: 1,
- pipeline: [{$telemetry: {}}, {$match: {"key.queryShape.find": {$eq: "###"}}}],
- cursor: {}
-}),
- ErrorCodes.QueryFeatureNotAllowed);
-
-MongoRunner.stopMongod(conn);
-}());