<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 05:30:46 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-53386] Allow unittests to explicitly set feature flags for certain tests</title>
                <link>https://jira.mongodb.org/browse/SERVER-53386</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;We should have a RAII type that allows for enabling or disabling a feature flag during execution of a unit test, or part of a unit test.&lt;/p&gt;

&lt;p&gt;While in general unit tests should not rely on environmental settings such as command line arguments or &lt;tt&gt;setParameter&lt;/tt&gt; values, some of our C++ unit tests for high level sharding or replication behavior do in fact depend on subsystems involving such parameters. Using an RAII type allows specific unit tests to select required behavior or even iterate over multiple settings where appropriate, while still maintaining the property that the unit test itself does not depend on command line arguments or similar.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1570242">SERVER-53386</key>
            <summary>Allow unittests to explicitly set feature flags for certain 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="13201">Fixed</resolution>
                                        <assignee username="pierlauro.sciarelli@mongodb.com">Pierlauro Sciarelli</assignee>
                                    <reporter username="pierlauro.sciarelli@mongodb.com">Pierlauro Sciarelli</reporter>
                        <labels>
                            <label>sharding-wfbf-day</label>
                    </labels>
                <created>Wed, 16 Dec 2020 14:14:32 +0000</created>
                <updated>Sun, 29 Oct 2023 21:59:31 +0000</updated>
                            <resolved>Sat, 6 Mar 2021 19:06:00 +0000</resolved>
                                                    <fixVersion>4.9.0</fixVersion>
                                    <component>Testing Infrastructure</component>
                                        <votes>0</votes>
                                    <watches>8</watches>
                                                                                                                <comments>
                            <comment id="3650879" author="pierlauro.sciarelli" created="Sat, 6 Mar 2021 19:10:45 +0000"  >&lt;p&gt;JFI - as suggested by Max during code review - the solution has been generalized so that any server parameter can now be changed during unit tests by using the &lt;a href=&quot;https://github.com/mongodb/mongo/blob/1b984a8d97112255bdc574036d08c95c799d74fd/src/mongo/idl/server_parameter_test_util.h#L40&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;RAIIServerParameterControllerForTest&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="3650761" author="xgen-internal-githook" created="Sat, 6 Mar 2021 15:19:43 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Pierlauro Sciarelli&apos;, &apos;email&apos;: &apos;pierlauro.sciarelli@mongodb.com&apos;, &apos;username&apos;: &apos;pierlauro&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-53386&quot; title=&quot;Allow unittests to explicitly set feature flags for certain tests&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-53386&quot;&gt;&lt;del&gt;SERVER-53386&lt;/del&gt;&lt;/a&gt; Allow unittests to explicitly set feature flags for certain tests&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/0fe8780da088b25bdc17d6b3e74e9de7b607e1d1&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/0fe8780da088b25bdc17d6b3e74e9de7b607e1d1&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="3549562" author="geert.bosch" created="Tue, 5 Jan 2021 20:13:07 +0000"  >&lt;p&gt;After speaking with Max and rereading the above comments, I believe there is consensus around the RAII approach, so I updated the description and title of this ticket to match. I&apos;ll move this ticket from investigating to ready for work.&lt;/p&gt;</comment>
                            <comment id="3549251" author="geert.bosch" created="Tue, 5 Jan 2021 18:11:20 +0000"  >&lt;p&gt;Unlike testing &lt;tt&gt;mongod&lt;/tt&gt;, I would not generally expect unittests to enable or disable features, just as we don&apos;t allow selecting different storage engines and the like. While we have a fair number of knobs for &lt;tt&gt;mongod&lt;/tt&gt;, it is not clear that it would be a good idea to copy that for unittests. &lt;/p&gt;</comment>
                            <comment id="3534058" author="pierlauro.sciarelli" created="Thu, 17 Dec 2020 11:12:41 +0000"  >&lt;p&gt;I like the RAII proposal, we could provide a simple scoped objects to be used just for unit tests. If the idea goes forward, the flags will be driven by each test case so we may consider disabling unit test tasks in the &quot;disabled feature flags&quot; variant to avoid confusion.&lt;/p&gt;</comment>
                            <comment id="3533511" author="max.hirschhorn@10gen.com" created="Wed, 16 Dec 2020 22:05:33 +0000"  >&lt;blockquote&gt;
&lt;p&gt;Unit tests calling into feature-guarded code should be executed just if the relative feature flag(s) are enabled.&lt;/p&gt;

&lt;p&gt;In addition, all features flags should be enabled for unit tests executed in the &quot;disabled feature flags&quot; variant.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;The &quot;disabled feature flags&quot; build variant depends on running tests through resmoke.py with the &amp;#45;&amp;#45;mongodSetParameter command line option to enable specific feature flags. I think adding a new command line option to unit test executables to enable specific feature flags (with the idea of the option being set automatically by resmoke.py) has some negative consequences. In particular:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;ninja +basename&amp;#95;of&amp;#95;test_file syntax wouldn&apos;t set this new option. Maybe there&apos;s some way to forward extra options?&lt;/li&gt;
	&lt;li&gt;gdb &amp;#45;&amp;#45;args ./build/install/bin/xx_test would now require engineers to remember to set the option themselves.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Given that our testing infrastructure&apos;s awareness of feature flags is equivalent to its awareness of server parameters, I&apos;m hoping we&apos;ll go about the situation with unit tests and feature flagging a different way. I feel like unit tests which care about a specific feature flag can  explicitly enable it within the test much like they do with changing server parameter values today. And this ticket could be repurposed to offer RAII types like we have with &lt;a href=&quot;https://github.com/mongodb/mongo/blob/6ee6a9d6f6ff15fc65bf13baeab3717dfb72eb20/src/mongo/util/fail_point.h#L483&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;FailPointEnableBlock&lt;/a&gt; to avoid polluting global state between tests.&lt;/p&gt;

&lt;p&gt;I&apos;d be curious to know about any projects which would benefit from multiple feature flags being enabled (one for their project and one for another project) but didn&apos;t know about which other project it was in advance where explicitly enumerating the combinations wasn&apos;t an option.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18555" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname># of Sprints</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 16 Dec 2020 22:05:33 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        2 years, 48 weeks, 4 days ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></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_17050" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Downstream Team Attention</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="16941"><![CDATA[Not Needed]]></customfieldvalue>

                        </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>luke.bonanomi@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            2 years, 48 weeks, 4 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>geert.bosch@mongodb.com</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>max.hirschhorn@mongodb.com</customfieldvalue>
            <customfieldvalue>pierlauro.sciarelli@mongodb.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hym5f3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hyctcv:</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_10557" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="4485">Sharding 2021-02-22</customfieldvalue>
    <customfieldvalue id="4486">Sharding 2021-03-08</customfieldvalue>

                        </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|hylrof:</customfieldvalue>

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