diff options
author | clang-format-7.0.1 <adam.martin@10gen.com> | 2019-07-26 18:42:24 -0400 |
---|---|---|
committer | ADAM David Alan Martin <adam.martin@10gen.com> | 2019-07-26 18:42:24 -0400 |
commit | c1a45ebbb0530e3d0201321d725527f1eb83ffce (patch) | |
tree | f523079dc5ded3052eefbdcaae424b7502df5b25 /jstests/watchdog/wd_setparam.js | |
parent | c9599d8610c3da0b7c3da65667aff821063cf5b9 (diff) | |
download | mongo-c1a45ebbb0530e3d0201321d725527f1eb83ffce.tar.gz |
Apply formatting per `clang-format-7.0.1`
Diffstat (limited to 'jstests/watchdog/wd_setparam.js')
-rw-r--r-- | jstests/watchdog/wd_setparam.js | 85 |
1 files changed, 42 insertions, 43 deletions
diff --git a/jstests/watchdog/wd_setparam.js b/jstests/watchdog/wd_setparam.js index 0857e11b1ff..cc74b96ef0c 100644 --- a/jstests/watchdog/wd_setparam.js +++ b/jstests/watchdog/wd_setparam.js @@ -1,60 +1,59 @@ // Storage Node Watchdog test cases // - Validate set parameter functions correctly. (function() { - 'use strict'; - const admin = db.getSiblingDB("admin"); +'use strict'; +const admin = db.getSiblingDB("admin"); - // Check the defaults are correct - // - function getparam(adminDb, field) { - let q = {getParameter: 1}; - q[field] = 1; +// Check the defaults are correct +// +function getparam(adminDb, field) { + let q = {getParameter: 1}; + q[field] = 1; - const ret = adminDb.runCommand(q); - return ret[field]; - } + const ret = adminDb.runCommand(q); + return ret[field]; +} - // Verify the defaults are as we documented them - assert.eq(getparam(admin, "watchdogPeriodSeconds"), -1); +// Verify the defaults are as we documented them +assert.eq(getparam(admin, "watchdogPeriodSeconds"), -1); - function setparam(adminDb, obj) { - const ret = adminDb.runCommand(Object.extend({setParameter: 1}, obj)); - return ret; - } +function setparam(adminDb, obj) { + const ret = adminDb.runCommand(Object.extend({setParameter: 1}, obj)); + return ret; +} - // Negative tests - // Negative: set it too low. - assert.commandFailed(setparam(admin, {"watchdogPeriodSeconds": 1})); - // Negative: set it the min value but fail since it was not enabled. - assert.commandFailed(setparam(admin, {"watchdogPeriodSeconds": 60})); - // Negative: set it the min value + 1 but fail since it was not enabled. - assert.commandFailed(setparam(admin, {"watchdogPeriodSeconds": 61})); +// Negative tests +// Negative: set it too low. +assert.commandFailed(setparam(admin, {"watchdogPeriodSeconds": 1})); +// Negative: set it the min value but fail since it was not enabled. +assert.commandFailed(setparam(admin, {"watchdogPeriodSeconds": 60})); +// Negative: set it the min value + 1 but fail since it was not enabled. +assert.commandFailed(setparam(admin, {"watchdogPeriodSeconds": 61})); - // Now test MongoD with it enabled at startup - // - const conn = MongoRunner.runMongod({setParameter: "watchdogPeriodSeconds=60"}); - assert.neq(null, conn, 'mongod was unable to start up'); +// Now test MongoD with it enabled at startup +// +const conn = MongoRunner.runMongod({setParameter: "watchdogPeriodSeconds=60"}); +assert.neq(null, conn, 'mongod was unable to start up'); - const admin2 = conn.getDB("admin"); +const admin2 = conn.getDB("admin"); - // Validate defaults - assert.eq(getparam(admin2, "watchdogPeriodSeconds"), 60); +// Validate defaults +assert.eq(getparam(admin2, "watchdogPeriodSeconds"), 60); - // Negative: set it too low. - assert.commandFailed(setparam(admin2, {"watchdogPeriodSeconds": 1})); - // Positive: set it the min value - assert.commandWorked(setparam(admin2, {"watchdogPeriodSeconds": 60})); - // Positive: set it the min value + 1 - assert.commandWorked(setparam(admin2, {"watchdogPeriodSeconds": 61})); +// Negative: set it too low. +assert.commandFailed(setparam(admin2, {"watchdogPeriodSeconds": 1})); +// Positive: set it the min value +assert.commandWorked(setparam(admin2, {"watchdogPeriodSeconds": 60})); +// Positive: set it the min value + 1 +assert.commandWorked(setparam(admin2, {"watchdogPeriodSeconds": 61})); - // Positive: disable it - assert.commandWorked(setparam(admin2, {"watchdogPeriodSeconds": -1})); +// Positive: disable it +assert.commandWorked(setparam(admin2, {"watchdogPeriodSeconds": -1})); - assert.eq(getparam(admin2, "watchdogPeriodSeconds"), -1); +assert.eq(getparam(admin2, "watchdogPeriodSeconds"), -1); - // Positive: enable it again - assert.commandWorked(setparam(admin2, {"watchdogPeriodSeconds": 60})); - - MongoRunner.stopMongod(conn); +// Positive: enable it again +assert.commandWorked(setparam(admin2, {"watchdogPeriodSeconds": 60})); +MongoRunner.stopMongod(conn); })(); |