[SERVER-28891] Move shard specific unit tests off of the ShardingMongodTestFixture onto the ShardServerTestFixture and refactor related scons bundles Created: 20/Apr/17  Updated: 27/Oct/23  Resolved: 02/Nov/22

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

Type: Improvement Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: [DO NOT USE] Backlog - Sharding Team
Resolution: Gone away Votes: 0
Labels: MaxH
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding
Participants:

 Description   

Shard specific unit tests using ShardingMongodTestFixture should be move onto the ShardServerTestFixture, so those tests no longer duplicate the set up code that ShardServerTestFixture would do for them.

Several of these tests, which have heavy dependencies, are also being compiled into executables together with lightweight unit tests running on the unittest::Test fixture. These should be split into different executables, so the lightweight unit test build times aren't unnecessarily long.

Unit tests using ShardingMongodTestFixture and setting up shard specific subsystems:
CollectionRangeDeleterTest
MetadataManagerTest

Lightweight unit tests combined with heavyweight unit tests in a single executable:
collection_metadata_test.cpp – unittest::Test
collection_sharding_state_test.cpp – unittest::Test
active_migrations_registry_test.cpp – unittest::Test

This unit test should not include both sharding_mongod_test_fixture and shard_server_test_fixture, as the latter includes the former.



 Comments   
Comment by Max Hirschhorn [ 02/Nov/22 ]

The CollectionRangeDeleterTest test cases were removed in SERVER-45024 as part of the work to rewrite the range deleter in MongoDB 4.4. And the MetadataManagerTest was modified to use ShardServerTestFixture by the changes from 083647f as part of SERVER-29908.

Someone could do a similar type of analysis like Kevin Pulo did in SERVER-51003 for the sharding-related test cases. But I haven't personally heard complaints in the years since SERVER-41809 related to compilation/rebuild times given the +test_file_name.cpp syntax in ninja.

Comment by Nathan Myers [ 16/May/17 ]

Thank you, I was just thinking I needed to look at those.

Comment by Dianna Hohensee (Inactive) [ 16/May/17 ]

nathan.myers, I have to move the ShardingStateTest and CollectionShardingStateTest onto the ShardServerTestFixture because my changes in SERVER-28724 are breaking them. No need to worry about them – apologies if you've already started changing them.

Comment by Dianna Hohensee (Inactive) [ 08/May/17 ]

It would be nice to move MigrationChunkClonerSourceLegacyTest and ShardingStateTest off of ShardingMongodTestFixure as well. But these are old tests that were around before ShardServerTestFixture and I'm unsure whether that would be easy or not. It would be nice to try it so as to see if they just move over to the new fixture easily.

Generated at Thu Feb 08 04:19:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.