Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-92277

Make batch_write_op_test unit test more representative

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing
    • 2

      batch_write_op_test.cpp and bulk_write_exec_test.cpp have several (most) test cases that set the mocked shards versions as ShardVersion::IGNORED (e.g. here). This is not representative of the real world – shards never have ShardVersion::IGNORED as their current shardVersion; ShardVersion::IGNORED is just a special version that routers attach when they do not want the shard to do shard version checking.

      As a consequence, several of the test cases do not match the reality. As an example, this test case asserts that the operation is executed in a single batch. However, it reality it will be two batches because the targeted writes will be targeted with a proper ShardVersion, and the broadcasted ones with ShardVersion::IGNORED.

      An example of a well-written test case setup is this one.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: