[JAVA-3112] Remove QueryBatchCursorFunctionalSpecification "should get more from a secondary" test Created: 06/Dec/18  Updated: 28/Oct/23  Resolved: 06/Dec/18

Status: Closed
Project: Java Driver
Component/s: Test Failure
Affects Version/s: None
Fix Version/s: 3.10.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   

Test only runs against replica sets. Seems to fail against 3.2 and 3.4 with auth and ssl enabled.

cursor.next()
|      |
|      com.mongodb.MongoQueryException: Query failed with error code 96 and error message 'collection dropped between getMore calls' on server localhost:27019
com.mongodb.operation.QueryBatchCursor@44a06d88
 (org.spockframework.runtime.ConditionFailedWithExceptionError)
 Condition failed with Exception:
 
 cursor.next()
 |      |
 |      com.mongodb.MongoQueryException: Query failed with error code 96 and error message 'collection dropped between getMore calls' on server localhost:27019
 com.mongodb.operation.QueryBatchCursor@44a06d88
 
 	at com.mongodb.operation.QueryBatchCursorFunctionalSpecification.should get more from a secondary(QueryBatchCursorFunctionalSpecification.groovy:559)
 Caused by: com.mongodb.MongoQueryException: Query failed with error code 96 and error message 'collection dropped between getMore calls' on server localhost:27019
 	at com.mongodb.operation.QueryHelper.translateCommandException(QueryHelper.java:29)
 	at com.mongodb.operation.QueryBatchCursor.getMore(QueryBatchCursor.java:229)
 	at com.mongodb.operation.QueryBatchCursor.hasNext(QueryBatchCursor.java:115)
 	at com.mongodb.operation.QueryBatchCursor.next(QueryBatchCursor.java:133)
 	... 1 more
 system-out:
 00:44:06.777 [Test worker] INFO  org.mongodb.driver.connection - Opened connection [connectionId{localValue:447, serverValue:30}] to localhost:27019



 Comments   
Comment by Githook User [ 14/Jan/19 ]

Author:

{'username': 'jyemin', 'email': 'jeff.yemin@10gen.com', 'name': 'Jeff Yemin'}

Message: Remove racy test

Rather than fix this test, just remove it. The justification is that
its really a test of the server behavior, not the driver, so it's not
worth the effort to remove the race.

JAVA-3112
Branch: 3.10.x
https://github.com/mongodb/mongo-java-driver/commit/3697766bb23e4a93234f4a77db4b7d1353e69a57

Comment by Githook User [ 06/Dec/18 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}

Message: Remove racy test

Rather than fix this test, just remove it. The justification is that
its really a test of the server behavior, not the driver, so it's not
worth the effort to remove the race.

JAVA-3112
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/1b04b1e48ccc55b6a94e7278b1e0a118c31b4e18

Comment by Jeffrey Yemin [ 06/Dec/18 ]

Decided to remove the test instead of fix the race, as this is really a test of server behavior not driver behavior.

Comment by Jeffrey Yemin [ 06/Dec/18 ]

I think this can be fixed by using a different collection name

Comment by Jeffrey Yemin [ 06/Dec/18 ]

Possible ordering of events:

  1. previous test in this spec drops collection in setup
  2. previous test inserts 10 documents in setup
  3. previous test drops the collection in tear down
  4. this test drops the collection in setup
  5. this test inserts 10 documents in setup
  6. this test does a find on secondary with batch size 2, and establishes a cursor
  7. drop from tear down of previous test replicates to the secondary
  8. getMore on the cursor fails with above error: "collection dropped between getMore calls"
Generated at Thu Feb 08 08:58:49 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.