diff options
author | Cheahuychou Mao <mao.cheahuychou@gmail.com> | 2023-05-15 14:32:39 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-05-15 16:52:55 +0000 |
commit | d3a01033d72ff2a39cfa5cb579e9a538f9a4da45 (patch) | |
tree | 586741b90f09a74289080f040025a86d6dfd0c65 | |
parent | 5e4700a33332daebdf3468c1276d401ab6974305 (diff) | |
download | mongo-d3a01033d72ff2a39cfa5cb579e9a538f9a4da45.tar.gz |
SERVER-76445 Re-enable analyze_shard_key.js in suites with chunk migration
-rw-r--r-- | jstests/concurrency/fsm_workloads/analyze_shard_key.js | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/jstests/concurrency/fsm_workloads/analyze_shard_key.js b/jstests/concurrency/fsm_workloads/analyze_shard_key.js index 6555dc777a2..09dc46feb89 100644 --- a/jstests/concurrency/fsm_workloads/analyze_shard_key.js +++ b/jstests/concurrency/fsm_workloads/analyze_shard_key.js @@ -14,7 +14,6 @@ * uses_transactions, * resource_intensive, * incompatible_with_concurrency_simultaneous, - * assumes_balancer_off, * ] */ load("jstests/concurrency/fsm_libs/extend_workload.js"); @@ -951,8 +950,13 @@ var $config = extendWorkload($config, function($config, $super) { const res = db.runCommand(cmdObj); try { assert.commandWorked(res); - assert.eq(res.nModified, 1, {cmdObj, res}); - assert.eq(res.n, 1, {cmdObj, res}); + if (res.n == 0) { + // TODO: Make this state always validate the response after BF-28440 is resolved. + assert(TestData.runningWithBalancer); + } else { + assert.eq(res.nModified, 1, {cmdObj, res}); + assert.eq(res.n, 1, {cmdObj, res}); + } } catch (e) { if (!this.isAcceptableUpdateError(res) && !(res.hasOwnProperty("writeErrors") && @@ -977,7 +981,12 @@ var $config = extendWorkload($config, function($config, $super) { }; print("Starting remove state " + tojsononeline(cmdObj)); const res = assert.commandWorked(db.runCommand(cmdObj)); - assert.eq(res.n, 1, {cmdObj, res}); + if (res.n == 0) { + // TODO: Make this state always validate the response after BF-28440 is resolved. + assert(TestData.runningWithBalancer); + } else { + assert.eq(res.n, 1, {cmdObj, res}); + } // Insert a random document to restore the original number of documents. assert.commandWorked( db.runCommand({insert: collName, documents: [this.generateRandomDocument(this.tid)]})); @@ -1001,8 +1010,13 @@ var $config = extendWorkload($config, function($config, $super) { const res = db.runCommand(cmdObj); try { assert.commandWorked(res); - assert.eq(res.lastErrorObject.n, 1, {cmdObj, res}); - assert.eq(res.lastErrorObject.updatedExisting, true, {cmdObj, res}); + if (res.lastErrorObject.n == 0) { + // TODO: Make this state always validate the response after BF-28440 is resolved. + assert(TestData.runningWithBalancer); + } else { + assert.eq(res.lastErrorObject.n, 1, {cmdObj, res}); + assert.eq(res.lastErrorObject.updatedExisting, true, {cmdObj, res}); + } } catch (e) { if (!this.isAcceptableUpdateError(res)) { throw e; @@ -1025,7 +1039,12 @@ var $config = extendWorkload($config, function($config, $super) { }; print("Starting findAndModifyRemove state " + tojsononeline(cmdObj)); const res = assert.commandWorked(db.runCommand(cmdObj)); - assert.eq(res.lastErrorObject.n, 1, {cmdObj, res}); + if (res.lastErrorObject.n == 0) { + // TODO: Make this state always validate the response after BF-28440 is resolved. + assert(TestData.runningWithBalancer); + } else { + assert.eq(res.lastErrorObject.n, 1, {cmdObj, res}); + } // Insert a random document to restore the original number of documents. assert.commandWorked( db.runCommand({insert: collName, documents: [this.generateRandomDocument(this.tid)]})); |