summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Jin Kang Park <yujin.kang@mongodb.com>2022-03-15 13:41:51 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-15 14:24:59 +0000
commit1614e2e0e743ec8cc59f6a6c24ee95e9e9c295ae (patch)
treee95b219c7c59accc3e74f37cf575ec7de697e923
parent92906f06daca886395569f8e656493936091e8a2 (diff)
downloadmongo-1614e2e0e743ec8cc59f6a6c24ee95e9e9c295ae.tar.gz
SERVER-53591 Change "coll_mod_takes_database_x_lock" to "coll_mod_takes_collection_x_lock"
-rw-r--r--jstests/noPassthroughWithMongod/coll_mod_takes_collection_x_lock.js (renamed from jstests/noPassthroughWithMongod/coll_mod_takes_database_x_lock.js)12
1 files changed, 8 insertions, 4 deletions
diff --git a/jstests/noPassthroughWithMongod/coll_mod_takes_database_x_lock.js b/jstests/noPassthroughWithMongod/coll_mod_takes_collection_x_lock.js
index b7fba31017e..46b055209db 100644
--- a/jstests/noPassthroughWithMongod/coll_mod_takes_database_x_lock.js
+++ b/jstests/noPassthroughWithMongod/coll_mod_takes_collection_x_lock.js
@@ -1,26 +1,30 @@
/**
- * Ensures that the 'collMod' command takes a database MODE_X lock during a no-op.
+ * Ensures that the 'collMod' command takes a Collection MODE_X lock during a no-op.
*/
(function() {
'use strict';
+// Note: failpoint name may not be changed due to backwards compatibility problem in
+// multiversion suites running JS tests using the failpoint.
+// In reality this hangs after acquiring a collection MODE_X lock (w/ database MODE_IX)."
const failpoint = 'hangAfterDatabaseLock';
assert.commandWorked(db.adminCommand({configureFailPoint: failpoint, mode: "alwaysOn"}));
const conn = db.getMongo();
-db.createCollection('foo');
+assert.commandWorked(db.createCollection('foo'));
// Run a no-op collMod command.
const awaitParallelShell = startParallelShell(() => {
assert.commandWorked(db.runCommand({collMod: 'foo'}));
}, conn.port);
-// Check that the database MODE_X lock is being held by checking in lockInfo.
+// Check that the Collection MODE_X lock is being held by checking in lockInfo.
assert.soon(() => {
let lockInfo = assert.commandWorked(db.adminCommand({lockInfo: 1})).lockInfo;
for (let i = 0; i < lockInfo.length; i++) {
let resourceId = lockInfo[i].resourceId;
- if (resourceId.includes("Database") && resourceId.includes("test")) {
+ const mode = lockInfo[i].granted[0].mode;
+ if (resourceId.includes("Collection") && resourceId.includes("test.foo") && mode === "X") {
return true;
}
}