<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:29:20 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-52899] Remove dependency on ScanningReplicaSetMonitor for unit tests</title>
                <link>https://jira.mongodb.org/browse/SERVER-52899</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently &lt;a href=&quot;https://github.com/mongodb/mongo/blob/39339fb164a4c51d8265bc6e3ab7d584f36a9c95/src/mongo/client/dbclient_rs_test.cpp#L87&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;dbclient_rs_test&lt;/a&gt; and &lt;a href=&quot;https://github.com/mongodb/mongo/blob/39339fb164a4c51d8265bc6e3ab7d584f36a9c95/src/mongo/db/repl/tenant_migration_recipient_service_test.cpp#L136-L137&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;tenant_migration_recipient_service_test&lt;/a&gt; use the ScanningReplicaSetMonitor because it supports some mocking capabilities, and the StreamableReplicaSetMonitor does not.&lt;/p&gt;

&lt;p&gt;Since we&apos;re removing production support for ScanningReplicaSetMonitor, we should also remove the need for it in unit tests. &lt;/p&gt;

&lt;p&gt;Some potential ideas for implementation:&lt;br/&gt;
1. Add a lightweight MockReplicaSetMonitor that only does what&apos;s necessary&lt;br/&gt;
2. Add the ability to mock some behaviors of StreamableReplicaSetMonitor&lt;br/&gt;
3. Make the tests in question depend on higher level components rather than directly on the RSM and mock those instead&lt;br/&gt;
4. Keep the ScanningReplicaSetMonitor and only use it for tests (in which case we&apos;d just close this ticket).&lt;/p&gt;

&lt;p&gt;If the decided outcome involves the complete removal of the ScanningReplicaSetMonitor, this ticket should either remove all remaining references to the ScanningReplicaSetMonitor from the codebase, or if it makes more sense to do it separately, make a separate ticket to do that.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1543556">SERVER-52899</key>
            <summary>Remove dependency on ScanningReplicaSetMonitor for unit tests</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="3">Duplicate</resolution>
                                        <assignee username="randolph@mongodb.com">Randolph Tan</assignee>
                                    <reporter username="matthew.saltz@mongodb.com">Matthew Saltz</reporter>
                        <labels>
                            <label>sharding-remove-scanning-rsm</label>
                            <label>sharding-wfbf-day</label>
                    </labels>
                <created>Mon, 16 Nov 2020 22:41:43 +0000</created>
                <updated>Mon, 17 May 2021 15:38:48 +0000</updated>
                            <resolved>Mon, 17 May 2021 15:38:47 +0000</resolved>
                                                                    <component>Networking</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3494125" author="lamont.nelson" created="Tue, 17 Nov 2020 17:58:51 +0000"  >&lt;p&gt;I have some ideas for this if you want. I think the current tests rely too much on the internal implementation details for ScanningRSM (I&apos;m thinking of db_client, as I haven&apos;t look at the other one that much). There really is only one method that matters in the public api for the RSM, which is &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/client/replica_set_monitor_interface.h#L81&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;getHosts&lt;/a&gt;. That method uses the topology manager and server selector to decide what hosts are available to get. With minimal code we could  avoid using a mock, and run the production code for the command path in the tests. The tests can build whatever state they need via the TopologyManager onServerDescription, or just install a full pointer to a TopologyDescription to describe the test scenario&apos;s topology. There is  a &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/client/sdam/server_description_builder.h#L40&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;fluent api class &lt;/a&gt; that facilitates creating server descriptions for testing. This would also require having a &apos;test mode&apos; flag so the ping and monitoring components don&apos;t actually try to connect to real servers. Basically by not actually scheduling any work, such as &lt;a href=&quot;https://github.com/mongodb/mongo/blob/master/src/mongo/client/server_ping_monitor.cpp#L69&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                            <outwardlinks description="depends on">
                                        <issuelink>
            <issuekey id="1612205">SERVER-54290</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="1612311">SERVER-54291</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1612311">SERVER-54291</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="1612328">SERVER-54292</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Tue, 17 Nov 2020 17:58:51 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 12 weeks, 1 day ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[<s><a href='https://jira.mongodb.org/browse/SERVER-54290'>SERVER-54290</a></s>]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>randolph@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 12 weeks, 1 day ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>lamont.nelson@mongodb.com</customfieldvalue>
            <customfieldvalue>matthew.saltz@mongodb.com</customfieldvalue>
            <customfieldvalue>randolph@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hyhmkn:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyhd9j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hyh8tz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>