-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust maxAwaitTimeMS by remaining timeout. #1650
base: main
Are you sure you want to change the base?
Conversation
JAVA-5720
JAVA-5720
JAVA-5720
{ | ||
"description": "apply remaining timeoutMS if less than maxAwaitTimeMS", | ||
"operations": [ | ||
{ | ||
"name": "failPoint", | ||
"object": "testRunner", | ||
"arguments": { | ||
"client": "failPointClient", | ||
"failPoint": { | ||
"configureFailPoint": "failCommand", | ||
"mode": { | ||
"times": 1 | ||
}, | ||
"data": { | ||
"failCommands": [ | ||
"getMore" | ||
], | ||
"blockConnection": true, | ||
"blockTimeMS": 30 | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "createFindCursor", | ||
"object": "collection", | ||
"arguments": { | ||
"filter": { | ||
"_id": 1 | ||
}, | ||
"cursorType": "tailableAwait", | ||
"batchSize": 1, | ||
"maxAwaitTimeMS": 100, | ||
"timeoutMS": 200 | ||
}, | ||
"saveResultAsEntity": "tailableCursor" | ||
}, | ||
{ | ||
"name": "iterateOnce", | ||
"object": "tailableCursor" | ||
}, | ||
{ | ||
"name": "iterateUntilDocumentOrError", | ||
"object": "tailableCursor", | ||
"expectError": { | ||
"isTimeoutError": true | ||
} | ||
} | ||
], | ||
"expectEvents": [ | ||
{ | ||
"client": "client", | ||
"ignoreExtraEvents": true, | ||
"events": [ | ||
{ | ||
"commandStartedEvent": { | ||
"commandName": "find", | ||
"databaseName": "test" | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"commandName": "getMore", | ||
"databaseName": "test", | ||
"command": { | ||
"maxTimeMS": { | ||
"$$lte": 100 | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"commandStartedEvent": { | ||
"commandName": "getMore", | ||
"databaseName": "test", | ||
"command": { | ||
"maxTimeMS": { | ||
"$$lte": 70 | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} | ||
] | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The failpoint is used here to delay the first getMore
by 30ms, reducing raciness and allowing verification that the second getMore
occurs with maxTimeMs
being less than 70ms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java
Outdated
Show resolved
Hide resolved
…fiedTestModifications.java Co-authored-by: Maxim Katcharov <maxim.katcharov@mongodb.com>
# Conflicts: # driver-sync/src/test/functional/com/mongodb/client/unified/UnifiedTestModifications.java
JAVA-5720