diff options
author | Benety Goh <benety@mongodb.com> | 2020-03-27 14:58:15 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-27 19:31:45 +0000 |
commit | f73a9645f68107d856bc882ad9e3fcdb0ee2f2ed (patch) | |
tree | 005c953b4d2ce165a561079bbf08e1fba6aff790 | |
parent | b70908c4898c4b02d8c70df3f796fa3e8cfe5bdd (diff) | |
download | mongo-f73a9645f68107d856bc882ad9e3fcdb0ee2f2ed.tar.gz |
SERVER-46621 add test for ns field for index build db.currentOp() entry
-rw-r--r-- | jstests/noPassthrough/indexbg_killop_primary.js | 12 | ||||
-rw-r--r-- | jstests/noPassthrough/indexbg_killop_secondary.js | 7 |
2 files changed, 17 insertions, 2 deletions
diff --git a/jstests/noPassthrough/indexbg_killop_primary.js b/jstests/noPassthrough/indexbg_killop_primary.js index 9c11825822c..ca0d7e9bbe0 100644 --- a/jstests/noPassthrough/indexbg_killop_primary.js +++ b/jstests/noPassthrough/indexbg_killop_primary.js @@ -36,7 +36,17 @@ const createIdx = // When the index build starts, find its op id. const opId = IndexBuildTest.waitForIndexBuildToScanCollection(testDB, coll.getName(), 'a_1'); -IndexBuildTest.assertIndexBuildCurrentOpContents(testDB, opId); +IndexBuildTest.assertIndexBuildCurrentOpContents(testDB, opId, (op) => { + jsTestLog('Inspecting db.currentOp() entry for index build: ' + tojson(op)); + assert.eq( + undefined, + op.connectionId, + 'Was expecting IndexBuildsCoordinator op; found db.currentOp() for connection thread instead: ' + + tojson(op)); + assert.eq('', + op.ns, + 'Unexpected ns field value in db.currentOp() result for index build: ' + tojson(op)); +}); // Kill the index builder thread. assert.commandWorked(testDB.killOp(opId)); diff --git a/jstests/noPassthrough/indexbg_killop_secondary.js b/jstests/noPassthrough/indexbg_killop_secondary.js index 9499278c35f..3628243108f 100644 --- a/jstests/noPassthrough/indexbg_killop_secondary.js +++ b/jstests/noPassthrough/indexbg_killop_secondary.js @@ -39,7 +39,12 @@ const createIdx = const secondaryDB = secondary.getDB(testDB.getName()); const opId = IndexBuildTest.waitForIndexBuildToStart(secondaryDB); -IndexBuildTest.assertIndexBuildCurrentOpContents(secondaryDB, opId); +IndexBuildTest.assertIndexBuildCurrentOpContents(secondaryDB, opId, (op) => { + jsTestLog('Inspecting db.currentOp() entry for index build: ' + tojson(op)); + assert.eq('', + op.ns, + 'Unexpected ns field value in db.currentOp() result for index build: ' + tojson(op)); +}); // Kill the index build. This should have no effect. assert.commandWorked(secondaryDB.killOp(opId)); |