-
Notifications
You must be signed in to change notification settings - Fork 1.1k
PYTHON-5369 - Re-raise socket.timeout errors if the deadline has alre… #2326
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
Changes from 3 commits
7a15f04
59e1897
7765b7d
55324d4
4005821
d851d85
e775c65
9136b56
968fc56
e5ec63a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,7 +117,7 @@ | |
WriteConcernError, | ||
) | ||
from pymongo.monitoring import ServerHeartbeatListener, ServerHeartbeatStartedEvent | ||
from pymongo.pool_options import _MAX_METADATA_SIZE, _METADATA, ENV_VAR_K8S, PoolOptions | ||
from pymongo.pool_options import _MAX_METADATA_SIZE, _METADATA, ENV_VAR_K8S, PoolOptions, _is_faas | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to remove this import There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bump |
||
from pymongo.read_preferences import ReadPreference | ||
from pymongo.server_description import ServerDescription | ||
from pymongo.server_selectors import readable_server_selector, writable_server_selector | ||
|
@@ -2010,6 +2010,7 @@ async def test_srv_max_hosts_kwarg(self): | |
"loadBalanced clients do not run SDAM", | ||
) | ||
@unittest.skipIf(sys.platform == "win32", "Windows does not support SIGSTOP") | ||
@unittest.skipUnless(_is_faas(), "Non-FaaS environments raise timeouts faster") | ||
@async_client_context.require_sync | ||
def test_sigstop_sigcont(self): | ||
test_dir = os.path.dirname(os.path.realpath(__file__)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,7 +106,7 @@ | |
WriteConcernError, | ||
) | ||
from pymongo.monitoring import ServerHeartbeatListener, ServerHeartbeatStartedEvent | ||
from pymongo.pool_options import _MAX_METADATA_SIZE, _METADATA, ENV_VAR_K8S, PoolOptions | ||
from pymongo.pool_options import _MAX_METADATA_SIZE, _METADATA, ENV_VAR_K8S, PoolOptions, _is_faas | ||
from pymongo.read_preferences import ReadPreference | ||
from pymongo.server_description import ServerDescription | ||
from pymongo.server_selectors import readable_server_selector, writable_server_selector | ||
|
@@ -1967,6 +1967,7 @@ def test_srv_max_hosts_kwarg(self): | |
"loadBalanced clients do not run SDAM", | ||
) | ||
@unittest.skipIf(sys.platform == "win32", "Windows does not support SIGSTOP") | ||
@unittest.skipUnless(_is_faas(), "Non-FaaS environments raise timeouts faster") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can't skip this test like this because we don't run the test suite on faas platforms. We want this test to run locally. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By "run locally", what exactly do you mean? As in we can't do this change because we need this test to run in our regular test suite? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps instead we can force the metadata to be faas through monkeypatching |
||
@client_context.require_sync | ||
def test_sigstop_sigcont(self): | ||
test_dir = os.path.dirname(os.path.realpath(__file__)) | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
I think we want sigstop/sigcont to work the same regardless of what env variables are defined. What if we take an alternative approach here and replace
not _is_faas()
withnot conn.is_sdam
? IE only do the extra non-blocking read on SDAM connections.Will that still fix the flaky tests?
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.
Are the flaky tests still fixed after the is_sdam change?
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.
They appear to be, yes: https://spruce.mongodb.com/version/681e08d75668e00007df8859/tasks?page=0&sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC&statuses=failed&taskName=%5E%28%28%3F%21pypy%29.%29*%24&variant=%5E%28%28%3F%21pypy%29.%29*%24. Filtering out PyPy failures, none of the flaky tests that should be fixed by this change are present.