[SERVER-22762] Convert collection_metadata_test and metadata_loader_test unittests to use CSRS Created: 19/Feb/16  Updated: 16/Mar/16  Resolved: 03/Mar/16

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

Type: Bug Priority: Major - P3
Reporter: Misha Tyulenev Assignee: Esha Maharishi (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 11 (03/11/16)
Participants:

 Description   

/db/s/collection_metadata_test.cpp and
/db/s/metadata_loader_test.cpp were implemented using SCCC catalog manager fixture. Need to be converted to use CSRS.



 Comments   
Comment by Githook User [ 03/Mar/16 ]

Author:

{u'name': u'Esha Maharishi', u'email': u'esha.maharishi@mongodb.come'}

Message: SERVER-22762 convert collection_metadata_test and metadata_loader_test to use CSRS
Branch: master
https://github.com/mongodb/mongo/commit/6cf5e55ea51079ef4d0770d51a4484e51f85acc4

Comment by Misha Tyulenev [ 25/Feb/16 ]

Here some tips to start:
For metadata_loader_test:
to unit test metadata loader we need to have a mock of CSRS catalog_manager. It can be done by deriving from ShardingTestFixture e.g.

class MetadataLoaderTest : public ShardingTestFixture {
protected:
    void setUp() override {
        ShardingTestFixture::setUp();
 
        getMessagingPort()->setRemote(HostAndPort("FakeRemoteClient:34567"));
        configTargeter()->setFindHostReturnValue(configHost);
    }
    const HostAndPort configHost{HostAndPort("ConfigHost:23456")};
 
};

and use network_test_env calls to set up the callbacks that will be returned by mock network to a catalog_manager

There are some examples in catalog_manager_replica_set_add_shard_test.cpp

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