[JAVA-2603] Fix racy test in ChangeStreamOperationSpecification Created: 18/Sep/17 Updated: 29/Oct/23 Resolved: 01/Dec/17 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Test Coverage |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Jeffrey Yemin | Assignee: | Jeffrey Yemin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
The test "should support return the expected results" in ChangeStreamOperationSpecification is racy. Because closing an asynchronous cursor is itself asynchronous, in some cases the cleanup checks in ServerHelper#checkPool can run before the close completes, resulting in the following failure:
So far, I haven't seen this in the debugger or on evergreen, but I can reproduce it with a local replica set with this command line:
|
| Comments |
| Comment by Githook User [ 04/Dec/17 ] |
|
Author: {'username': 'jyemin', 'email': 'jeff.yemin@10gen.com', 'name': 'Jeff Yemin'}Message: Avoid a race condition between the async cursor closing and the check for checked out connections in the common cleanup method |
| Comment by Githook User [ 01/Dec/17 ] |
|
Author: {'name': 'Jeff Yemin', 'username': 'jyemin', 'email': 'jeff.yemin@10gen.com'}Message: Avoid a race condition between the async cursor closing and the check for checked out connections in the common cleanup method |
| Comment by Jeffrey Yemin [ 27/Nov/17 ] |
|
Fixed in: https://github.com/mongodb/mongo-java-driver/commit/8e62c8aa42e383ef42be11ee15dc59167af14dc0 |
| Comment by Jeffrey Yemin [ 18/Oct/17 ] |
|
A similar change stream-related failure showed up in Evergreen here |