Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-4173

Replace use sleep in SyncMongoCursor test class

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Test Coverage
    • Labels:
      None

      Some of the new load balancer unified tests assert on expected events which occur when creating and closing a cursor.  But the SyncMongoCursor test class is, necessarily, built on top of a Reactive Streams Publisher, which make it difficult to determine when:

      • the cursor has been established
      • the cursor has been closed

      To work around these problems, short sleep}}s were added to both the {{SyncMongoCursor constructor and close method.

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

      We should consider alternative approaches that are both less expensive in the happy path and generated clearer test failures in the sad path.

            Assignee:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Reporter:
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: