diff options
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/core/capped_update.js | 2 | ||||
-rw-r--r-- | jstests/core/dbadmin.js | 7 | ||||
-rw-r--r-- | jstests/core/hello_response_validation.js | 17 | ||||
-rw-r--r-- | jstests/core/opcounters_write_cmd.js | 14 | ||||
-rw-r--r-- | jstests/core/read_after_optime.js | 5 |
5 files changed, 33 insertions, 12 deletions
diff --git a/jstests/core/capped_update.js b/jstests/core/capped_update.js index d15c6939fcd..17b7f55ae39 100644 --- a/jstests/core/capped_update.js +++ b/jstests/core/capped_update.js @@ -5,6 +5,8 @@ * @tags: [ * requires_capped, * uses_testing_only_commands, + * # godinsert and can't run under replication + * assumes_standalone_mongod, * ] */ (function() { diff --git a/jstests/core/dbadmin.js b/jstests/core/dbadmin.js index 7bd946f1eef..29aaae432db 100644 --- a/jstests/core/dbadmin.js +++ b/jstests/core/dbadmin.js @@ -1,4 +1,9 @@ -load('jstests/aggregation/extras/utils.js'); +// @tags: [ +// # Assert on the isWritablePrimary field of a hello response. If a primary steps down after +// # accepting a hello command and returns before its connection is closed, the response can +// # contain isWritablePrimary: false. +// does_not_support_stepdowns, +// ] (function() { 'use strict'; diff --git a/jstests/core/hello_response_validation.js b/jstests/core/hello_response_validation.js index d4efc80462d..0094e0b8b2f 100644 --- a/jstests/core/hello_response_validation.js +++ b/jstests/core/hello_response_validation.js @@ -1,7 +1,15 @@ -/** - * This test ensures that the hello command and its aliases, ismaster and isMaster, are all - * accepted. - */ +// +// This test ensures that the hello command and its aliases, ismaster and isMaster, +// are all accepted. +// +// @tags: [ +// # Assert on the isWritablePrimary field of a hello response. If a primary steps down after +// # accepting a hello command and returns before its connection is closed, the response can +// # contain isWritablePrimary: false. +// does_not_support_stepdowns, +// ] + +(function() { "use strict"; function checkResponseFields(commandString) { @@ -88,3 +96,4 @@ assert.eq(cmdResponse1, cmdResponse2); cmdResponse1 = removeTimestamps(db.runCommand("isMaster")); cmdResponse2 = removeTimestamps(db.isMaster()); assert.eq(cmdResponse1, cmdResponse2); +})(); diff --git a/jstests/core/opcounters_write_cmd.js b/jstests/core/opcounters_write_cmd.js index 28660083cbe..ab2b832d035 100644 --- a/jstests/core/opcounters_write_cmd.js +++ b/jstests/core/opcounters_write_cmd.js @@ -1,9 +1,13 @@ // Test that opcounters get incremented properly. // @tags: [ // uses_multiple_connections, +// assumes_standalone_mongod, // ] // Legacy write mode test also available at jstests/gle. +(function() { +'use strict'; + var mongo = new Mongo(db.getMongo().host); var newdb = mongo.getDB(db.toString()); @@ -158,9 +162,9 @@ t.insert({_id: 0}); assert.commandWorked(newdb.runCommand({listCollections: 1})); // Command, recognized, no error. -serverStatus = newdb.runCommand({serverStatus: 1}); +var serverStatus = newdb.runCommand({serverStatus: 1}); opCounters = serverStatus.opcounters; -metricsObj = serverStatus.metrics.commands; +var metricsObj = serverStatus.metrics.commands; assert.eq(opCounters.command + 1, newdb.serverStatus().opcounters.command); // "serverStatus" counted // Count this and the last run of "serverStatus" @@ -172,10 +176,7 @@ assert.eq(metricsObj.serverStatus.failed, "failed ServerStatus command counter incremented!"); // "serverStatus" counted // Command, recognized, with error. -countVal = { - "total": 0, - "failed": 0 -}; +var countVal = {"total": 0, "failed": 0}; if (metricsObj.count != null) { countVal = metricsObj.count; } @@ -198,3 +199,4 @@ assert.eq(opCounters.command + 8, newdb.serverStatus().opcounters.command); // "serverStatus" counted assert.eq(null, newdb.serverStatus().metrics.commands.invalid); assert.eq(metricsObj['<UNKNOWN>'] + 1, newdb.serverStatus().metrics.commands['<UNKNOWN>']); +})(); diff --git a/jstests/core/read_after_optime.js b/jstests/core/read_after_optime.js index 0345b358f45..b43fdbd8bd5 100644 --- a/jstests/core/read_after_optime.js +++ b/jstests/core/read_after_optime.js @@ -1,5 +1,8 @@ // Test that attempting to read after optime fails if replication is not enabled. -// @tags: [multiversion_incompatible] +// @tags: [ +// multiversion_incompatible, +// assumes_standalone_mongod +// ] (function() { "use strict"; |