[SERVER-53091] Consolidate the Sharding unit-tests into 3 binaries only Created: 27/Nov/20  Updated: 29/Oct/23  Resolved: 27/Nov/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Improvement Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kaloian Manassiev
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-11-30
Participants:

 Description   

Currently, the Sharding unit-tests are scattered across at least 5 different binaries and it is (a) hard to decide where exactly to place a new unit-test and (b) hard to figure out which one exactly to compile when making changes. The unit-tests should ideally be combined into just 2 binaries: one under db/s and one under s/. However, because the ConfigServerTestFixture and the ShardServerTestFixture register different static objects on the OperationContext (the VectorClock is one such notable example), it is not possible to put the two of them in the same binary.

However, we should at least make them into 3 binaries:

  • db_s_shard_server_test: All tests, which use the ShardServerTestFixture and logically are tests, which exercise behaviour specific to how a Shard would act. These tests have a storage engine, but the ConfigShard is abstracted through the NetworkInterfaceMock and all communication with the ConfigServer needs to be emulated through that mock.
  • db_s_config_server_test: All tests, which use the ConfigServerTestFixture and logically are tests, which exercise behaviour specific to how a ConfigServer would act. These tests have a storage engine, but the ConfigShard is actually a LocalShard so operations against it go through the DBDirectClient.
  • s_test: All tests, which use the ShardingRouterTestFixture and logically are tests, which exercise behaviour specific to how a Router would act. These tests do not have a storage engine and all Shard communication needs to be abstracted through the NetworkInterfaceMock.


 Comments   
Comment by Githook User [ 27/Nov/20 ]

Author:

{'name': 'Kaloian Manassiev', 'email': 'kaloian.manassiev@mongodb.com', 'username': 'kaloianm'}

Message: SERVER-53091 Consolidate the Sharding unit-tests into 3 binaries only
Branch: master
https://github.com/mongodb/mongo/commit/1ea96eb8fca79d92ddf3bf5598e950d76fc0ff98

Generated at Thu Feb 08 05:29:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.