<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:37:45 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>[GODRIVER-2068] Replace all uses of isPoolCleared() and clearPoolChan() in tests with testPoolMonitor</title>
                <link>https://jira.mongodb.org/browse/GODRIVER-2068</link>
                <project id="14289" key="GODRIVER">Go Driver</project>
                    <description>&lt;p&gt;Various &lt;tt&gt;mongo/integration&lt;/tt&gt; package tests currently use a package-global &lt;tt&gt;event.PoolMonitor&lt;/tt&gt; variable &lt;tt&gt;poolMonitor&lt;/tt&gt; to collect connection pool events and the package-global functions &lt;tt&gt;isPoolCleared()&lt;/tt&gt; and &lt;tt&gt;clearPoolChan()&lt;/tt&gt; to manage the collected events. The result is that different tests and test cases can sometimes interact with each others events, causing intermittent assertion failures or timeouts on channel sends (e.g. when the &lt;tt&gt;poolMonitor&lt;/tt&gt;&apos;s events channel fills up without being cleared).&lt;/p&gt;

&lt;p&gt;To resolve the unexpected interaction between tests, replace all uses of the package-global &lt;tt&gt;poolMonitor&lt;/tt&gt; with individual instances of the new &lt;tt&gt;testPoolMonitor&lt;/tt&gt;. Also, replace &lt;tt&gt;isPoolCleared()&lt;/tt&gt; with the condition:&lt;/p&gt;
&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;poolClearedEvents := tpm.Events(func(evt *event.PoolEvent) bool {&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;	return evt.Type == event.PoolCleared&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;})&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;len(poolClearedEvents) &amp;gt; 0&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Also consider moving &lt;tt&gt;testPoolMonitor&lt;/tt&gt; into a shared test utilities package and export it. Use it for similar use cases from other tests, like &lt;tt&gt;topology.TestServerConnectionTimeout&lt;/tt&gt; and &lt;tt&gt;topology.TestServerConnectionCancellation&lt;/tt&gt;.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1801042">GODRIVER-2068</key>
            <summary>Replace all uses of isPoolCleared() and clearPoolChan() in tests with testPoolMonitor</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="10300" iconUrl="https://jira.mongodb.org/images/icons/priorities/medium.svg">Unknown</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="9">Done</resolution>
                                        <assignee username="matt.dale@mongodb.com">Matt Dale</assignee>
                                    <reporter username="matt.dale@mongodb.com">Matt Dale</reporter>
                        <labels>
                            <label>greenerbuild</label>
                    </labels>
                <created>Mon, 28 Jun 2021 17:23:03 +0000</created>
                <updated>Mon, 4 Apr 2022 18:55:20 +0000</updated>
                            <resolved>Mon, 4 Apr 2022 18:55:20 +0000</resolved>
                                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="4451229" author="xgen-internal-githook" created="Fri, 1 Apr 2022 18:35:52 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{&apos;name&apos;: &apos;Matt Dale&apos;, &apos;email&apos;: &apos;9760375+matthewdale@users.noreply.github.com&apos;, &apos;username&apos;: &apos;matthewdale&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/GODRIVER-2068&quot; title=&quot;Replace all uses of isPoolCleared() and clearPoolChan() in tests with testPoolMonitor&quot; class=&quot;issue-link&quot; data-issue-key=&quot;GODRIVER-2068&quot;&gt;&lt;del&gt;GODRIVER-2068&lt;/del&gt;&lt;/a&gt; Use monitor.TestPoolMonitor to replace most connection pool monitors in tests. (#890)&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/commit/3d60e915318c66ac5cee869dd15e2e5c56ac269f&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/commit/3d60e915318c66ac5cee869dd15e2e5c56ac269f&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4446237" author="JIRAUSER1259527" created="Wed, 30 Mar 2022 22:29:24 +0000"  >&lt;p&gt;PR: &lt;a href=&quot;https://github.com/mongodb/mongo-go-driver/pull/890&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-go-driver/pull/890&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="4436470" author="JIRAUSER1259527" created="Fri, 25 Mar 2022 21:55:10 +0000"  >&lt;p&gt;Using a &lt;tt&gt;TestPoolMonitor&lt;/tt&gt; for the &lt;tt&gt;TestServerConnectionTimeout/operation_context_timeout_with_unrelated_dial_errors_should_clear_the_pool&lt;/tt&gt; test may improve reliability of that test. See failure example &lt;a href=&quot;https://evergreen.mongodb.com/lobster/evergreen/test/mongo_go_driver_tests_40_with_zlib_support__version~4.0_os_ssl_40~windows_64_go_1_16_test_sharded_noauth_nossl_57747f8fe7130b6afdade2a946d399afe6ae7079_22_03_24_22_11_58/0/test/#bookmarks=0%2C15900&amp;amp;l=1&amp;amp;shareLine=15669&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="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="1766838">GODRIVER-2037</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hz9ogn:</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>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>