diff options
author | Moustafa Maher Khalil <m.maher@mongodb.com> | 2023-04-07 17:53:24 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-04-07 22:18:38 +0000 |
commit | c2f3e2e88b73042db802a2d711c1ae052e50d0a0 (patch) | |
tree | bbc6671adc1cf0806850c9a029f9f5f8c0b482e6 | |
parent | a6a34a2c447af98df83145932f95355917a20142 (diff) | |
download | mongo-c2f3e2e88b73042db802a2d711c1ae052e50d0a0.tar.gz |
SERVER-75601 Create a separate test for apiVersions section of FTDC
(cherry picked from commit 4f9633bcd9fc54719319b3c1d73bf2ec8daa5607)
-rw-r--r-- | etc/backports_required_for_multiversion_tests.yml | 4 | ||||
-rw-r--r-- | jstests/libs/ftdc.js | 7 | ||||
-rw-r--r-- | jstests/noPassthrough/ftdc_omit_api_versions.js | 26 |
3 files changed, 26 insertions, 11 deletions
diff --git a/etc/backports_required_for_multiversion_tests.yml b/etc/backports_required_for_multiversion_tests.yml index 916ef8b180d..800fc0256cb 100644 --- a/etc/backports_required_for_multiversion_tests.yml +++ b/etc/backports_required_for_multiversion_tests.yml @@ -270,8 +270,6 @@ last-continuous: ticket: SERVER-67105 - test_file: jstests/core/clustered_collection_bounded_scan.js ticket: SERVER-67105 - - test_file: jstests/replsets/tenant_migration_metrics_output.js - ticket: SERVER-75601 - test_file: jstests/core/map_reduce_subplanning.js ticket: SERVER-74131 - test_file: jstests/sharding/resharding_interrupt_before_create_state_machine.js @@ -623,8 +621,6 @@ last-lts: ticket: SERVER-67105 - test_file: jstests/core/clustered_collection_bounded_scan.js ticket: SERVER-67105 - - test_file: jstests/replsets/tenant_migration_metrics_output.js - ticket: SERVER-75601 - test_file: jstests/core/map_reduce_subplanning.js ticket: SERVER-74131 - test_file: jstests/sharding/resharding_interrupt_before_create_state_machine.js diff --git a/jstests/libs/ftdc.js b/jstests/libs/ftdc.js index dbf20495a81..105769c5c93 100644 --- a/jstests/libs/ftdc.js +++ b/jstests/libs/ftdc.js @@ -41,13 +41,6 @@ function verifyGetDiagnosticData(adminDb) { "does not have 'serverStatus' in '" + tojson(data) + "'"); assert(data.hasOwnProperty("end"), "does not have 'end' in '" + tojson(data) + "'"); - // 'apiVersions' section is omitted from serverStatus metrics. - assert(data["serverStatus"].hasOwnProperty("metrics"), - "does not have 'serverStatus.metrics' in '" + tojson(data) + "'"); - assert(!data["serverStatus"]["metrics"].hasOwnProperty("apiVersions"), - "'serverStatus.metrics.apiVersions' should be omitted from FTDC data: '" + - tojson(data) + "'"); - foundGoodDocument = true; jsTestLog("Got good getDiagnosticData: " + tojson(result)); diff --git a/jstests/noPassthrough/ftdc_omit_api_versions.js b/jstests/noPassthrough/ftdc_omit_api_versions.js new file mode 100644 index 00000000000..a4a864f3871 --- /dev/null +++ b/jstests/noPassthrough/ftdc_omit_api_versions.js @@ -0,0 +1,26 @@ +/** + * This test is to make sure that 'apiVersions' section is omitted from serverStatus metrics in + * FTDC data. + */ +load('jstests/libs/ftdc.js'); + +(function() { +'use strict'; +let conn = MongoRunner.runMongod(); +let adminDb = conn.getDB('admin'); + +// Verify 'apiVersions' section is omitted from serverStatus metrics. +let ftdcData = verifyGetDiagnosticData(adminDb); +assert(ftdcData["serverStatus"].hasOwnProperty("metrics"), + "does not have 'serverStatus.metrics' in '" + tojson(ftdcData) + "'"); +assert(!ftdcData["serverStatus"]["metrics"].hasOwnProperty("apiVersions"), + "'serverStatus.metrics.apiVersions' should be omitted from FTDC data: '" + tojson(ftdcData) + + "'"); + +// Make sure that 'apiVersions' section still be returned with serverStatus metrics. +let serverStatusMetrics = adminDb.serverStatus().metrics; +assert(serverStatusMetrics.hasOwnProperty("apiVersions"), + "does not have 'apiVersions' in '" + tojson(serverStatusMetrics) + "'"); + +MongoRunner.stopMongod(conn); +})(); |