diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2017-07-12 09:22:58 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2018-03-12 15:46:23 -0400 |
commit | 46fc1d293fe782cce144060fc895d39efe77d6bf (patch) | |
tree | 8caa4cd23474c4bcb64ae0efc8642fa20dca694d /jstests/core/diagdata.js | |
parent | 2b8d573e40fe26b9285a053ed3b7a8e62f68c2e2 (diff) | |
download | mongo-46fc1d293fe782cce144060fc895d39efe77d6bf.tar.gz |
SERVER-28495 FTDC for MongoS
(cherry picked from commit 02c46a3d4b270530335f542ad2926c50f1ba1b1f)
Diffstat (limited to 'jstests/core/diagdata.js')
-rw-r--r-- | jstests/core/diagdata.js | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/jstests/core/diagdata.js b/jstests/core/diagdata.js index 490e4a3eb2b..6938f8c5102 100644 --- a/jstests/core/diagdata.js +++ b/jstests/core/diagdata.js @@ -1,4 +1,5 @@ // Test that verifies getDiagnosticData returns FTDC data +load('jstests/libs/ftdc.js'); (function() { "use strict"; @@ -6,28 +7,5 @@ // Verify we require admin database assert.commandFailed(db.diagdata.runCommand("getDiagnosticData")); - // We need to retry a few times if run this test immediately after mongod is started as FTDC may - // not have run yet. - var foundGoodDocument = false; - - for (var i = 0; i < 60; ++i) { - var result = db.adminCommand("getDiagnosticData"); - assert.commandWorked(result); - - var data = result.data; - - if (!data.hasOwnProperty("start")) { - // Wait a little longer for FTDC to start - sleep(500); - } else { - // Check for a few common properties to ensure we got data - assert(data.hasOwnProperty("serverStatus"), - "does not have 'serverStatus' in '" + tojson(data) + "'"); - assert(data.hasOwnProperty("end"), "does not have 'end' in '" + tojson(data) + "'"); - foundGoodDocument = true; - } - } - assert(foundGoodDocument, - "getDiagnosticData failed to return a non-empty command, is FTDC running?"); - + verifyGetDiagnosticData(db.getSiblingDB('admin')); })(); |