<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 09:01:25 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>[JAVA-4173] Replace use sleep in SyncMongoCursor test class</title>
                <link>https://jira.mongodb.org/browse/JAVA-4173</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Some of the new load balancer unified tests assert on expected events which occur when creating and closing a cursor.&#160; But the SyncMongoCursor test class is, necessarily, built on top of a Reactive Streams Publisher, which make it difficult to determine when:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;the cursor has been established&lt;/li&gt;
	&lt;li&gt;the cursor has been closed&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;To work around these problems, short &lt;tt&gt;sleep}}s were added to both the {{SyncMongoCursor&lt;/tt&gt; constructor and &lt;tt&gt;close&lt;/tt&gt; method.&lt;/p&gt;

&lt;p&gt;In limited usage, these sleeps are effective, but ultimately they are racy and some non-zero percentage&#160;of time will cause test failures (the percentage can be decreased by increasing the sleep time, but that will slow down test runs).&lt;/p&gt;

&lt;p&gt;We should consider alternative approaches that are both less expensive in the happy path and generated clearer test failures in the sad path.&lt;/p&gt;</description>
                <environment></environment>
        <key id="1738402">JAVA-4173</key>
            <summary>Replace use sleep in SyncMongoCursor test class</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="jeff.yemin@mongodb.com">Jeffrey Yemin</assignee>
                                    <reporter username="jeff.yemin@mongodb.com">Jeffrey Yemin</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 May 2021 19:35:50 +0000</created>
                <updated>Tue, 1 Jun 2021 14:14:09 +0000</updated>
                            <resolved>Tue, 1 Jun 2021 14:14:09 +0000</resolved>
                                                                    <component>Test Coverage</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="3851039" author="jeff.yemin" created="Tue, 1 Jun 2021 14:14:09 +0000"  >&lt;p&gt;Decided to close as won&apos;t fix.  We can re-open if the sleep approach proves unreliable.&lt;/p&gt;</comment>
                            <comment id="3838794" author="JIRAUSER1258163" created="Tue, 25 May 2021 17:32:33 +0000"  >&lt;p&gt;I see. Thank you for the explanation. Indeed, the current approach seems to be the lesser of evils.&lt;/p&gt;</comment>
                            <comment id="3819993" author="jeff.yemin" created="Mon, 24 May 2021 20:48:42 +0000"  >&lt;p&gt;I tried to implement this, and ran into what seemed to be a road block.  &lt;/p&gt;

&lt;p&gt;Consider &lt;a href=&quot;https://github.com/mongodb/specifications/blob/master/source/load-balancers/tests/wait-queue-timeouts.yml#L38-L59&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this test&lt;/a&gt;.  It creates a find cursor, and then tries an insert, asserting that the insert failed because of a connection wait queue timeout.  In order to make that work, the test runner either has to wait for a little bit after creating the find cursor, or before executing the insert.  It makes more sense to do the former than the latter, because it could be almost anything that comes after, not just an insert, that is relying on the cursor to have been established.  So we could put a sleep in the createFindCursor handler, but that would also apply to the sync driver.  In the end, it seems better to leave the sleep where it is, in the test code that is adapting the reactive driver to the sync driver API.&lt;/p&gt;</comment>
                    </comments>
                    <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|hyk7bz:</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>