-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: 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.