diff options
Diffstat (limited to 'jstests')
21 files changed, 41 insertions, 43 deletions
diff --git a/jstests/core/max_time_ms.js b/jstests/core/max_time_ms.js index 7597084430d..5c5ad508805 100644 --- a/jstests/core/max_time_ms.js +++ b/jstests/core/max_time_ms.js @@ -33,7 +33,7 @@ cursor.maxTimeMS(100); error = assert.throws(function() { cursor.itcount(); }, [], "expected query to abort due to time limit"); -assert.eq(ErrorCodes.ExceededTimeLimit, error.code); +assert.eq(ErrorCodes.MaxTimeMSExpired, error.code); // // Simple negative test for query: a ~300ms query with a 10s time limit should not hit the time @@ -83,7 +83,7 @@ error = assert.throws(function() { cursor.next(); cursor.next(); }, [], "expected batch 2 (getmore) to abort due to time limit"); -assert.eq(ErrorCodes.ExceededTimeLimit, error.code); +assert.eq(ErrorCodes.MaxTimeMSExpired, error.code); // // Simple negative test for getmore: @@ -139,7 +139,7 @@ cursor.maxTimeMS(6 * 1000); error = assert.throws(function() { cursor.itcount(); }, [], "expected find() to abort due to time limit"); -assert.eq(ErrorCodes.ExceededTimeLimit, error.code); +assert.eq(ErrorCodes.MaxTimeMSExpired, error.code); // // Many-batch negative test for getmore: @@ -171,7 +171,7 @@ assert.doesNotThrow(function() { t.drop(); res = t.getDB().adminCommand({sleep: 1, millis: 300, maxTimeMS: 100}); -assert(res.ok == 0 && res.code == ErrorCodes.ExceededTimeLimit, +assert(res.ok == 0 && res.code == ErrorCodes.MaxTimeMSExpired, "expected sleep command to abort due to time limit, ok=" + res.ok + ", code=" + res.code); // @@ -299,7 +299,7 @@ t.drop(); assert.eq( 1, t.getDB().adminCommand({configureFailPoint: "maxTimeAlwaysTimeOut", mode: "alwaysOn"}).ok); res = t.getDB().runCommand({ping: 1, maxTimeMS: 10 * 1000}); -assert(res.ok == 0 && res.code == ErrorCodes.ExceededTimeLimit, +assert(res.ok == 0 && res.code == ErrorCodes.MaxTimeMSExpired, "expected command to trigger maxTimeAlwaysTimeOut fail point, ok=" + res.ok + ", code=" + res.code); assert.eq(1, t.getDB().adminCommand({configureFailPoint: "maxTimeAlwaysTimeOut", mode: "off"}).ok); @@ -412,7 +412,7 @@ assert.commandWorked( error = assert.throws(function() { cursor.itcount(); }, [], "expected query to abort due to time limit"); -assert.eq(ErrorCodes.ExceededTimeLimit, error.code); +assert.eq(ErrorCodes.MaxTimeMSExpired, error.code); assert.commandWorked( t.getDB().adminCommand({configureFailPoint: "maxTimeAlwaysTimeOut", mode: "off"})); diff --git a/jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js b/jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js index 2708f5a6d37..b6b6b6e5bc8 100644 --- a/jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js +++ b/jstests/core/txns/abort_transaction_thread_does_not_block_on_locks.js @@ -91,7 +91,7 @@ // Wait for the drop to have a pending MODE_X lock on the database, which will block // MODE_IS lock requests behind it. return testDB.runCommand({find: collName, maxTimeMS: 100}).code === - ErrorCodes.ExceededTimeLimit; + ErrorCodes.MaxTimeMSExpired; }); // Should take 'transactionLifeTime' plus the period of the transaction aborter thread, diff --git a/jstests/core/txns/abort_transactions_on_FCV_downgrade.js b/jstests/core/txns/abort_transactions_on_FCV_downgrade.js index e398066e425..46ade87dcd7 100644 --- a/jstests/core/txns/abort_transactions_on_FCV_downgrade.js +++ b/jstests/core/txns/abort_transactions_on_FCV_downgrade.js @@ -23,7 +23,7 @@ jsTestLog("Attempt to drop the collection. This should fail due to the open transaction."); assert.commandFailedWithCode(testDB.runCommand({drop: collName, maxTimeMS: 1000}), - ErrorCodes.ExceededTimeLimit); + ErrorCodes.MaxTimeMSExpired); jsTestLog("Downgrade the featureCompatibilityVersion."); assert.commandWorked(testDB.adminCommand({setFeatureCompatibilityVersion: lastStableFCV})); diff --git a/jstests/core/txns/transactions_block_ddl.js b/jstests/core/txns/transactions_block_ddl.js index 0d6c4d1aa56..298795d004f 100644 --- a/jstests/core/txns/transactions_block_ddl.js +++ b/jstests/core/txns/transactions_block_ddl.js @@ -27,7 +27,7 @@ assert.commandWorked(sessionColl.insert({a: 5, b: 6})); assert.commandFailedWithCode( testDB.getSiblingDB(cmdDBName).runCommand(Object.assign({}, ddlCmd, {maxTimeMS: 500})), - ErrorCodes.ExceededTimeLimit); + ErrorCodes.MaxTimeMSExpired); assert.commandWorked(session.commitTransaction_forTesting()); } diff --git a/jstests/core/txns/write_conflicts_with_non_txns.js b/jstests/core/txns/write_conflicts_with_non_txns.js index 5fcf7cdaad6..1ea9535b9ae 100644 --- a/jstests/core/txns/write_conflicts_with_non_txns.js +++ b/jstests/core/txns/write_conflicts_with_non_txns.js @@ -70,7 +70,7 @@ jsTestLog("Do a conflicting single document insert outside of transaction with maxTimeMS."); assert.commandFailedWithCode( testColl.runCommand({insert: collName, documents: [nonTxnDoc], maxTimeMS: 100}), - ErrorCodes.ExceededTimeLimit); + ErrorCodes.MaxTimeMSExpired); jsTestLog("Doing conflicting single document write in separate thread."); let thread = new ScopedThread(singleDocWrite, dbName, collName, nonTxnDoc); diff --git a/jstests/noPassthrough/afterClusterTime_committed_reads.js b/jstests/noPassthrough/afterClusterTime_committed_reads.js index 0f9bc1480c7..5c488ca69f4 100644 --- a/jstests/noPassthrough/afterClusterTime_committed_reads.js +++ b/jstests/noPassthrough/afterClusterTime_committed_reads.js @@ -45,7 +45,7 @@ writeConcern: {w: "majority"}, maxTimeMS: 1000 }), - ErrorCodes.ExceededTimeLimit); + ErrorCodes.MaxTimeMSExpired); // Restart replication. restartReplicationOnSecondaries(rst); diff --git a/jstests/noPassthrough/readConcern_atClusterTime_snapshot_selection.js b/jstests/noPassthrough/readConcern_atClusterTime_snapshot_selection.js index 91a754a595a..6c650a2cded 100644 --- a/jstests/noPassthrough/readConcern_atClusterTime_snapshot_selection.js +++ b/jstests/noPassthrough/readConcern_atClusterTime_snapshot_selection.js @@ -73,7 +73,7 @@ primarySession.startTransaction( {readConcern: {level: "snapshot", atClusterTime: clusterTimeAfter}}); assert.commandFailedWithCode(primaryDB.runCommand({find: collName, maxTimeMS: 1000}), - ErrorCodes.ExceededTimeLimit); + ErrorCodes.MaxTimeMSExpired); primarySession.abortTransaction(); // Restart replication on one of the secondaries. @@ -101,7 +101,7 @@ secondarySession.startTransaction( {readConcern: {level: "snapshot", atClusterTime: clusterTimeAfter}}); assert.commandFailedWithCode(secondaryDB0.runCommand({find: collName, maxTimeMS: 1000}), - ErrorCodes.ExceededTimeLimit); + ErrorCodes.MaxTimeMSExpired); secondarySession.abortTransaction(); // Restart replication on the lagged secondary. diff --git a/jstests/noPassthrough/read_majority.js b/jstests/noPassthrough/read_majority.js index a8e1b9f4221..2aa9c826a65 100644 --- a/jstests/noPassthrough/read_majority.js +++ b/jstests/noPassthrough/read_majority.js @@ -51,7 +51,7 @@ load("jstests/libs/analyze_plan.js"); var res = t.runCommand('find', {batchSize: 2, readConcern: {level: level}, maxTimeMS: 1000}); assert.commandFailed(res); - assert.eq(res.code, ErrorCodes.ExceededTimeLimit); + assert.eq(res.code, ErrorCodes.MaxTimeMSExpired); } function getCursorForReadConcernLevel() { diff --git a/jstests/noPassthroughWithMongod/validate_interrupt.js b/jstests/noPassthroughWithMongod/validate_interrupt.js index 758eaa6839b..7b76551f4e4 100644 --- a/jstests/noPassthroughWithMongod/validate_interrupt.js +++ b/jstests/noPassthroughWithMongod/validate_interrupt.js @@ -29,7 +29,7 @@ if (res.ok === 0) { assert.eq(res.code, - ErrorCodes.ExceededTimeLimit, + ErrorCodes.MaxTimeMSExpired, 'validate command did not time out:\n' + tojson(res)); } else { // validate() should only succeed if it EBUSY'd. See SERVER-23131. diff --git a/jstests/replsets/await_replication_timeout.js b/jstests/replsets/await_replication_timeout.js index 93600d2ca81..2fb4e6e9471 100644 --- a/jstests/replsets/await_replication_timeout.js +++ b/jstests/replsets/await_replication_timeout.js @@ -32,8 +32,7 @@ // Test maxTimeMS timeout res = testDB.runCommand( {insert: collName, documents: [{a: 1}], writeConcern: {w: 3}, maxTimeMS: 1000}); - assert.commandFailedWithCode(res, ErrorCodes.ExceededTimeLimit); - assert.eq(ErrorCodes.ExceededTimeLimit, res.writeConcernError.code); + assert.commandFailedWithCode(res, ErrorCodes.MaxTimeMSExpired); // Test with wtimeout < maxTimeMS res = testDB.runCommand({ @@ -52,8 +51,7 @@ writeConcern: {w: 3, wtimeout: 10 * 1000}, maxTimeMS: 1000 }); - assert.commandFailedWithCode(res, ErrorCodes.ExceededTimeLimit); - assert.eq(ErrorCodes.ExceededTimeLimit, res.writeConcernError.code); + assert.commandFailedWithCode(res, ErrorCodes.MaxTimeMSExpired); // dropDatabase respects the 'w' field when it is stronger than the default of majority. res = testDB.runCommand({dropDatabase: 1, writeConcern: {w: 3, wtimeout: 1000}}); diff --git a/jstests/replsets/dbhash_at_cluster_time.js b/jstests/replsets/dbhash_at_cluster_time.js index d2a77899003..27f4e0f79db 100644 --- a/jstests/replsets/dbhash_at_cluster_time.js +++ b/jstests/replsets/dbhash_at_cluster_time.js @@ -98,7 +98,7 @@ // However, the "dbHash" command should block behind the transaction if "atClusterTime" // wasn't specified. res = assert.commandFailedWithCode(db.runCommand({dbHash: 1, maxTimeMS: 1000}), - ErrorCodes.ExceededTimeLimit); + ErrorCodes.MaxTimeMSExpired); otherSession.abortTransaction(); otherSession.endSession(); diff --git a/jstests/replsets/linearizable_read_concern.js b/jstests/replsets/linearizable_read_concern.js index da544cc9e55..64ccaa32bc9 100644 --- a/jstests/replsets/linearizable_read_concern.js +++ b/jstests/replsets/linearizable_read_concern.js @@ -87,7 +87,7 @@ load('jstests/libs/write_concern_util.js'); var result = primary.getDB("test").runCommand( {"find": "foo", "readConcern": {level: "linearizable"}, "maxTimeMS": 3000}); - assert.commandFailedWithCode(result, ErrorCodes.ExceededTimeLimit); + assert.commandFailedWithCode(result, ErrorCodes.MaxTimeMSExpired); jsTestLog("Testing to make sure linearizable read command does not block forever."); diff --git a/jstests/replsets/read_after_optime.js b/jstests/replsets/read_after_optime.js index 1059d5b1c62..c9369074fee 100644 --- a/jstests/replsets/read_after_optime.js +++ b/jstests/replsets/read_after_optime.js @@ -28,7 +28,7 @@ readConcern: {afterOpTime: {ts: twoKSecTS, t: term}}, maxTimeMS: 5000, }), - ErrorCodes.ExceededTimeLimit); + ErrorCodes.MaxTimeMSExpired); }; // Run the time out test 3 times with replication debug log level increased to 2 diff --git a/jstests/replsets/read_committed_after_rollback.js b/jstests/replsets/read_committed_after_rollback.js index a4e6ffdacbd..bdb83b144a8 100644 --- a/jstests/replsets/read_committed_after_rollback.js +++ b/jstests/replsets/read_committed_after_rollback.js @@ -15,7 +15,7 @@ load("jstests/replsets/rslib.js"); // For startSetIfSupportsReadMajority. coll.runCommand('find', {"readConcern": {"level": "majority"}, "maxTimeMS": 3000}); assert.commandFailedWithCode( res, - ErrorCodes.ExceededTimeLimit, + ErrorCodes.MaxTimeMSExpired, "Expected read of " + coll.getFullName() + ' on ' + coll.getMongo().host + " to block"); } diff --git a/jstests/replsets/read_committed_no_snapshots.js b/jstests/replsets/read_committed_no_snapshots.js index df7ee835fd6..02bec8e69f7 100644 --- a/jstests/replsets/read_committed_no_snapshots.js +++ b/jstests/replsets/read_committed_no_snapshots.js @@ -66,7 +66,7 @@ load("jstests/replsets/rslib.js"); // For reconfig and startSetIfSupportsReadMa assert.commandFailedWithCode( noSnapshotSecondary.getDB(name).foo.runCommand( 'find', {"readConcern": {"level": "majority"}, "maxTimeMS": 1000}), - ErrorCodes.ExceededTimeLimit); + ErrorCodes.MaxTimeMSExpired); // Reconfig to make the no-snapshot secondary the primary var config = primary.getDB("local").system.replset.findOne(); @@ -79,6 +79,6 @@ load("jstests/replsets/rslib.js"); // For reconfig and startSetIfSupportsReadMa assert.commandFailedWithCode( primary.getSiblingDB(name).foo.runCommand( 'find', {"readConcern": {"level": "majority"}, "maxTimeMS": 1000}), - ErrorCodes.ExceededTimeLimit); + ErrorCodes.MaxTimeMSExpired); replTest.stopSet(); })(); diff --git a/jstests/replsets/read_committed_with_catalog_changes.js b/jstests/replsets/read_committed_with_catalog_changes.js index 95322fd3da5..b60fda763f2 100644 --- a/jstests/replsets/read_committed_with_catalog_changes.js +++ b/jstests/replsets/read_committed_with_catalog_changes.js @@ -218,7 +218,7 @@ load("jstests/replsets/rslib.js"); // For startSetIfSupportsReadMajority. var res = coll.runCommand('find', {"readConcern": {"level": "majority"}, "maxTimeMS": 5000}); assert.commandFailedWithCode(res, - ErrorCodes.ExceededTimeLimit, + ErrorCodes.MaxTimeMSExpired, "Expected read of " + coll.getFullName() + " to block"); } diff --git a/jstests/replsets/stepdown_catch_up_opt.js b/jstests/replsets/stepdown_catch_up_opt.js index 48bd11adde1..4fd88748ae4 100644 --- a/jstests/replsets/stepdown_catch_up_opt.js +++ b/jstests/replsets/stepdown_catch_up_opt.js @@ -17,7 +17,7 @@ // Error codes we expect to see. // If the secondary is not caught up. - var noCaughtUpSecondariesCode = 50; + const noCaughtUpSecondariesCode = ErrorCodes.ExceededTimeLimit; // If the stepdown period is shorter than the secondaryCatchUpPeriodSecs argument. var stepDownPeriodTooShortCode = 2; diff --git a/jstests/sharding/linearizable_read_concern.js b/jstests/sharding/linearizable_read_concern.js index 637566e1b2d..1269bc5c4a3 100644 --- a/jstests/sharding/linearizable_read_concern.js +++ b/jstests/sharding/linearizable_read_concern.js @@ -122,7 +122,7 @@ load("jstests/libs/write_concern_util.js"); readConcern: {level: "linearizable"}, maxTimeMS: 3000 }); - assert.commandFailedWithCode(result, ErrorCodes.ExceededTimeLimit); + assert.commandFailedWithCode(result, ErrorCodes.MaxTimeMSExpired); st.stop(); })(); diff --git a/jstests/sharding/max_time_ms_sharded.js b/jstests/sharding/max_time_ms_sharded.js index 8c6e25a3d1f..42179fad314 100644 --- a/jstests/sharding/max_time_ms_sharded.js +++ b/jstests/sharding/max_time_ms_sharded.js @@ -125,8 +125,8 @@ configureMaxTimeAlwaysTimeOut("alwaysOn"); assert.commandFailedWithCode( coll.runCommand("validate", {maxTimeMS: 60 * 1000}), - ErrorCodes.ExceededTimeLimit, - "expected vailidate to fail with code " + ErrorCodes.ExceededTimeLimit + + ErrorCodes.MaxTimeMSExpired, + "expected vailidate to fail with code " + ErrorCodes.MaxTimeMSExpired + " due to maxTimeAlwaysTimeOut fail point, but instead got: " + tojson(res)); // Negative test for "validate". @@ -136,11 +136,11 @@ // Positive test for "count". configureMaxTimeAlwaysTimeOut("alwaysOn"); - assert.commandFailedWithCode( - coll.runCommand("count", {maxTimeMS: 60 * 1000}), - ErrorCodes.ExceededTimeLimit, - "expected count to fail with code " + ErrorCodes.ExceededTimeLimit + - " due to maxTimeAlwaysTimeOut fail point, but instead got: " + tojson(res)); + assert.commandFailedWithCode(coll.runCommand("count", {maxTimeMS: 60 * 1000}), + ErrorCodes.MaxTimeMSExpired, + "expected count to fail with code " + ErrorCodes.MaxTimeMSExpired + + " due to maxTimeAlwaysTimeOut fail point, but instead got: " + + tojson(res)); // Negative test for "count". configureMaxTimeAlwaysTimeOut("off"); @@ -151,8 +151,8 @@ configureMaxTimeAlwaysTimeOut("alwaysOn"); assert.commandFailedWithCode( coll.runCommand("collStats", {maxTimeMS: 60 * 1000}), - ErrorCodes.ExceededTimeLimit, - "expected collStats to fail with code " + ErrorCodes.ExceededTimeLimit + + ErrorCodes.MaxTimeMSExpired, + "expected collStats to fail with code " + ErrorCodes.MaxTimeMSExpired + " due to maxTimeAlwaysTimeOut fail point, but instead got: " + tojson(res)); // Negative test for "collStats". @@ -174,8 +174,8 @@ }); assert.commandFailedWithCode( res, - ErrorCodes.ExceededTimeLimit, - "expected mapReduce to fail with code " + ErrorCodes.ExceededTimeLimit + + ErrorCodes.MaxTimeMSExpired, + "expected mapReduce to fail with code " + ErrorCodes.MaxTimeMSExpired + " due to maxTimeAlwaysTimeOut fail point, but instead got: " + tojson(res)); // Negative test for "mapReduce". @@ -196,8 +196,8 @@ configureMaxTimeAlwaysTimeOut("alwaysOn"); assert.commandFailedWithCode( coll.runCommand("aggregate", {pipeline: [], cursor: {}, maxTimeMS: 60 * 1000}), - ErrorCodes.ExceededTimeLimit, - "expected aggregate to fail with code " + ErrorCodes.ExceededTimeLimit + + ErrorCodes.MaxTimeMSExpired, + "expected aggregate to fail with code " + ErrorCodes.MaxTimeMSExpired + " due to maxTimeAlwaysTimeOut fail point, but instead got: " + tojson(res)); // Negative test for "aggregate". diff --git a/jstests/sharding/max_time_ms_sharded_new_commands.js b/jstests/sharding/max_time_ms_sharded_new_commands.js index 2084f1b711d..c8072359ce1 100644 --- a/jstests/sharding/max_time_ms_sharded_new_commands.js +++ b/jstests/sharding/max_time_ms_sharded_new_commands.js @@ -26,7 +26,7 @@ assert.commandFailedWithCode( admin.runCommand( {setFeatureCompatibilityVersion: lastStableFCV, maxTimeMS: 1000 * 60 * 60 * 24}), - ErrorCodes.ExceededTimeLimit, + ErrorCodes.MaxTimeMSExpired, "expected setFeatureCompatibilityVersion to fail due to maxTimeAlwaysTimeOut fail point"); // Negative test for "setFeatureCompatibilityVersion" diff --git a/jstests/sharding/read_after_optime.js b/jstests/sharding/read_after_optime.js index b174a288834..ce8c5201179 100644 --- a/jstests/sharding/read_after_optime.js +++ b/jstests/sharding/read_after_optime.js @@ -33,7 +33,7 @@ var pingIntervalSeconds = 10; assert.commandFailedWithCode( runFindCommand(new Timestamp(lastOp.ts.getTime() + pingIntervalSeconds * 5, 0)), - ErrorCodes.ExceededTimeLimit); + ErrorCodes.MaxTimeMSExpired); var msg = 'Command on database local timed out waiting for read concern to be satisfied.'; assert.soon(function() { |
