diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2023-02-08 22:03:04 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-02-09 11:23:11 +0000 |
commit | 4185cda9e51154dae02956a3c13f4c8d9cec48d6 (patch) | |
tree | 67677c991fe38b61368ddbcc3b9e97d68ae95321 /jstests | |
parent | 7be8b2f04f5d2e487015c4fcb92b7ff6aa81dc57 (diff) | |
download | mongo-4185cda9e51154dae02956a3c13f4c8d9cec48d6.tar.gz |
SERVER-73735 Fail configuration more gracefully if telemetry is disabled
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/noPassthroughWithMongod/telemetry_configuration.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/jstests/noPassthroughWithMongod/telemetry_configuration.js b/jstests/noPassthroughWithMongod/telemetry_configuration.js new file mode 100644 index 00000000000..8d0b6ed68b5 --- /dev/null +++ b/jstests/noPassthroughWithMongod/telemetry_configuration.js @@ -0,0 +1,32 @@ +/** + * Tests that the telemetry store can be resized if it is configured, and cannot be resized if it is + * disabled. + */ +(function() { +"use strict"; + +load("jstests/libs/feature_flag_util.js"); + +if (FeatureFlagUtil.isEnabled(db, "Telemetry")) { + // The feature flag is enabled - make sure the telemetry store can be configured. + const original = assert.commandWorked( + db.adminCommand({getParameter: 1, internalQueryConfigureTelemetryCacheSize: 1})); + assert(original.hasOwnProperty("internalQueryConfigureTelemetryCacheSize"), original); + const originalValue = original.internalQueryConfigureTelemetryCacheSize; + try { + assert.doesNotThrow( + () => db.adminCommand( + {setParameter: 1, internalQueryConfigureTelemetryCacheSize: '2MB'})); + // Other tests verify that resizing actually affects the data structure size. + } finally { + assert.doesNotThrow( + () => db.adminCommand( + {setParameter: 1, internalQueryConfigureTelemetryCacheSize: originalValue})); + } +} else { + // The feature flag is disabled - make sure the telemetry store *cannot* be configured. + assert.commandFailedWithCode( + db.adminCommand({setParameter: 1, internalQueryConfigureTelemetryCacheSize: '2MB'}), + 7373500); +} +}()); |