diff options
author | Ruoxin Xu <ruoxin.xu@mongodb.com> | 2020-08-30 20:40:26 +0100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-02 10:59:45 +0000 |
commit | 5154eca6d3a3489d7cc537453cb8672524242085 (patch) | |
tree | 288a05f05cf5fc42ae8dfaef8ef3905e4af5ac5b /jstests/concurrency | |
parent | 69145064d3315c1f89bd7abfacde0087c5845501 (diff) | |
download | mongo-5154eca6d3a3489d7cc537453cb8672524242085.tar.gz |
SERVER-50208 Modify existing update tests to guarantee $v:2 oplog entries generation
Diffstat (limited to 'jstests/concurrency')
-rw-r--r-- | jstests/concurrency/fsm_workloads/update_inc_pipeline.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/jstests/concurrency/fsm_workloads/update_inc_pipeline.js b/jstests/concurrency/fsm_workloads/update_inc_pipeline.js index bb4d78d7bcd..95fdc674ab1 100644 --- a/jstests/concurrency/fsm_workloads/update_inc_pipeline.js +++ b/jstests/concurrency/fsm_workloads/update_inc_pipeline.js @@ -16,5 +16,17 @@ var $config = extendWorkload($config, function($config, $super) { $config.data.update_inc = "update_inc_pipeline"; + $config.setup = function(db, collName, cluster) { + // Add 'largeStr' to the documents in order to make pipeline-based updates generate delta + // oplog entries. + var doc = {_id: this.id, largeStr: '*'.repeat(128)}; + + // Pre-populate the fields we need to avoid size change for capped collections. + for (var i = 0; i < this.threadCount; ++i) { + doc['t' + i] = 0; + } + assert.commandWorked(db[collName].insert(doc)); + }; + return $config; }); |