Noah Stapp
e1751ff253
PYTHON-5668 - Merge backpressure branch into mainline ( #2729 )
...
Co-authored-by: Steven Silvester <steve.silvester@mongodb.com>
Co-authored-by: Shane Harvey <shnhrv@gmail.com>
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
Co-authored-by: Iris <58442094+sleepyStick@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Kevin Albertson <kevin.albertson@mongodb.com>
Co-authored-by: Casey Clements <caseyclements@users.noreply.github.com>
Co-authored-by: Sergey Zelenov <mail@zelenov.su>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-14 12:25:29 -04:00
Steven Silvester
0ce7686c64
PYTHON-5563 Fix unified test discovery ( #2644 )
2025-12-16 13:30:30 -06:00
Steven Silvester
1f308c841f
PYTHON-5480 Update Python 3.9-specific tests to use Python 3.10 ( #2560 )
2025-09-25 12:52:30 -05:00
Iris
947fbe33ee
PYTHON-5421 Make parse_uri() return "options" as a dict rather than _CaseInsensitiveDictionary ( #2413 )
2025-07-02 09:51:50 -07:00
Steven Silvester
2eb18f18b2
PYTHON-5428 Mark test_connection_close_does_not_block_other_operations as flaky ( #2415 )
2025-07-02 11:22:12 -05:00
Steven Silvester
1bcb85f1c1
PYTHON-5321 Remove Serverless testing ( #2359 )
2025-06-09 19:46:10 -05:00
Noah Stapp
09897b698e
PYTHON-5212 - Do not hold Topology lock while resetting pool ( #2301 )
2025-04-23 15:13:38 -04:00
Iris
eea8a37257
PYTHON-3636 AsyncMongoClient should perform SRV resolution lazily ( #2191 )
...
Co-authored-by: Noah Stapp <noah@noahstapp.com>
Co-authored-by: Shane Harvey <shane.harvey@mongodb.com>
2025-03-25 13:45:06 -07:00
Noah Stapp
34ca759f85
PYTHON-5113 - Refactor test utils for async ( #2149 )
2025-03-12 12:59:56 -04:00
Shane Harvey
de09181b1c
PYTHON-4960 More informative error message for stale primary ( #2115 )
2025-03-05 10:30:52 -08:00
Iris
150a3ba756
PYTHON-5078 Convert test.test_discovery_and_monitoring to async ( #2093 )
...
Co-authored-by: Noah Stapp <noah@noahstapp.com>
2025-03-03 10:14:04 -08:00
Shane Harvey
85ca6f1d9f
PYTHON-4579 Stop gossiping $clusterTime on SDAM connections ( #1925 )
2025-02-26 13:18:04 -08:00
Shane Harvey
ac198af557
PYTHON-4729 Drop support for MongoDB 3.6 ( #1905 )
2024-10-09 09:58:20 -07:00
Noah Stapp
739510214b
PYTHON-4731 - Explicitly close all MongoClients opened during tests ( #1855 )
2024-09-17 09:22:17 -04:00
Noah Stapp
ffa6555485
PYTHON-4476 Separate data and IO classes more effectively ( #1678 )
2024-06-26 10:12:39 -07:00
Noah Stapp
d6bf0e1e78
PYTHON-4264 Async PyMongo Beta ( #1629 )
2024-06-06 09:01:24 -07:00
Shane Harvey
70bb43b30b
PYTHON-4334 Fix test_heartbeat_start_ordering, ensure TCPServer starts before client ( #1599 )
2024-04-16 16:18:10 -07:00
Noah Stapp
b041ca5f7c
PYTHON-4022 - Ensure ServerHeartbeatStartedEvents are emitted before connecting ( #1542 )
2024-03-05 07:53:53 -08:00
Steven Silvester
992d1507e7
PYTHON-4005 Replace flake8 and isort with ruff ( #1399 )
2023-10-19 11:56:22 -05:00
Shane Harvey
1cbd192a84
PYTHON-3995 Fix race in serverMonitoringMode test ( #1393 )
2023-10-16 15:27:49 -07:00
Shane Harvey
4c00227c1d
PYTHON-3668 Use polling SDAM mode on FaaS and add sdamMode=auto/stream/poll ( #1360 )
...
Disable streaming SDAM by default on AWS Lambda and similar FaaS platforms.
Introduce the serverMonitoringMode=stream/poll/auto URI option.
Add Unified Test Format version 1.17 to add support for server heartbeat events.
2023-10-12 13:19:16 -07:00
Noah Stapp
c88ae79e58
PYTHON-3879 Rename SocketInfo to Connection ( #1329 )
2023-07-28 10:04:16 -07:00
Shane Harvey
0092b0af79
PYTHON-2504 Run pyupgrade 3.4.0 and ruff 0.0.265 ( #1196 )
...
pyupgrade --py37-plus bson/*.py pymongo/*.py gridfs/*.py test/*.py tools/*.py test/*/*.py
ruff --fix-only --select ALL --fixable ALL --target-version py37 --line-length=100 --unfixable COM812,D400,D415,ERA001,RUF100,SIM108,D211,D212,SIM105,SIM,PT,ANN204,EM bson/*.py pymongo/*.py gridfs/*.py test/*.py test/*/*.py
2023-05-11 15:27:17 -07:00
Shane Harvey
13e2715af0
PYTHON-3312 Convert SDAM integration tests to unified ( #1028 )
2022-08-03 15:34:16 -07:00
Shane Harvey
890cd26e1a
PYTHON-3288 Implement client side operation timeout ( #954 )
...
Add timeoutMS URI option and MongoClient keyword argument.
Add provisional/beta pymongo.timeout() api to set a deadline for a block of operations.
2022-06-06 15:36:52 -04:00
Shane Harvey
225d131c2d
PYTHON-2970 Prioritize electionId over setVersion for stale primary check ( #845 )
2022-03-09 11:13:18 -08:00
Steven Silvester
a0fe7c03af
PYTHON-3120 Set up flake8 linting ( #868 )
2022-02-17 06:44:08 -06:00
Steven Silvester
5578999a90
PYTHON-1834 Use a code formatter ( #852 )
2022-02-09 06:44:28 -06:00
Steven Silvester
f4cef37328
PYTHON-3064 Add typings to test package ( #844 )
2022-02-07 19:33:41 -06:00
Shane Harvey
d504c1f399
PYTHON-2086 Verify max set version and max election id on topologies in SDAM spec tests
2021-12-09 14:03:01 -08:00
Bernie Hackett
ad4315134c
PYTHON-2803 Get rid of most uses of 'master'
...
This change also resolves PYTHON-2848 for MongoDB 4.0.
2021-09-13 12:50:49 -07:00
Prashant Mital
3f8c104157
PYTHON-2288 Remove IsMaster ( #690 )
2021-07-29 10:32:51 -07:00
Shane Harvey
a7921604f1
PYTHON-2768 Add SDAM and server selection spec tests for load balancers ( #655 )
2021-06-24 12:32:52 -07:00
Prashant Mital
ff6ca53328
PYTHON-2572 Introduce NotPrimaryError and deprecate NotMasterError ( #646 )
2021-06-22 13:24:07 -07:00
Shane Harvey
112ee69de8
PYTHON-2674 Pool.reset only clears connections to the given serviceId ( #628 )
2021-06-15 09:52:30 -07:00
Shane Harvey
93ac5e0277
PYTHON-2676 Add load balancer tests in EVG ( #625 )
...
Add load balancer spec tests
Ensure LB supports retryable reads/writes
Add assertNumberConnectionsCheckedOut, createFindCursor, ignoreResultAndError
Add PoolClearedEvent.service_id and fix isClientError unified test assertion
2021-05-27 15:05:26 -07:00
Shane Harvey
f64b563d9e
PYTHON-2629 Use hello command when API Version is declared ( #610 )
...
PYTHON-2697 Update CMAP runner to ignore extra events
2021-05-10 14:33:51 -07:00
Shane Harvey
20d5a9cf81
PYTHON-2543 Do not mark a server unknown from a "writeErrors" response ( #570 )
2021-03-01 14:09:27 -08:00
Bernie Hackett
521f7b9af4
PYTHON-2133 Fix up docs
...
And finish deleting python 2 specific code.
2021-01-21 15:49:23 -08:00
Bernie Hackett
a72e8b8823
PYTHON-2133 Remove py2 support from test
...
Also delete bson/py3compat.py
2021-01-20 09:40:36 -08:00
Shane Harvey
86b40c195d
PYTHON-2462 Avoid connection storms: implement pool PAUSED state ( #531 )
...
Mark server unknown and clear the pool when background connections fail.
Eagerly evict threads from the wait queue when pool is paused. Evicted
threads will raise the following error:
AutoReconnect('localhost:27017: connection pool paused')
Introduce PoolClearedEvent and ConnectionPoolListener.pool_ready.
CMAP spec test changes:
- CMAP unit tests should not use real monitors
- Assert that CMAP threads complete all scheduled operations
2021-01-06 15:15:37 -08:00
Shane Harvey
7903a1c4e1
PYTHON-2332 Skip threaded SDAM tests when cdecimal is monkey patched ( #477 )
...
Add 60 second timeout for joining threads in SDAM tests.
2020-08-12 14:55:19 -07:00
Shane Harvey
64f77068e1
PYTHON-1438 Mark a server unknown when connection handshake fails with a network timeout error ( #461 )
2020-07-08 17:46:07 -07:00
Prashant Mital
04926c6ccd
fix monitor failure
2020-07-01 17:52:35 -07:00
Prashant Mital
956ce3d4b0
Incorporate review changes
2020-07-01 16:47:33 -07:00
Shane Harvey
1f4123e4bf
PYTHON-2123 Streaming heartbeat protocol
...
MongoClient now requires 2 connections and 2 threads to each MongoDB 4.4+ server.
With one connection, the server streams (or pushes) updated heartbeat info.
With the other connection, the client periodically pings the server to
establish an accurate round-trip time (RTT). This change optimizes the
discovery of server state changes such as replica set elections.
Additional changes:
- Mark server Unknown before retrying isMaster check.
- Always reset the pool _after_ marking the server unknown.
- Configure fail point before creating the client in test SpecRunner.
- Unfreeze with replSetFreeze:0 to ensure a speedy elections in test suite.
2020-07-01 14:49:46 -07:00
Prashant Mital
74202455aa
PYTHON-2278 Fix Jython SDAM test failures
2020-06-16 15:55:21 -07:00
Prashant Mital
0743c0b222
PYTHON-2121 add directConnection URI option
2020-06-08 15:11:55 -07:00
Shane Harvey
7099e1be8b
PYTHON-2199 Reduce race conditions in SDAM error handling
...
Use Pool.generation and topologyVersion to reduce race conditions
SDAM error handling.
Implement SDAM error handling spec tests.
2020-04-28 16:47:13 -07:00
Shane Harvey
e989be53c1
PYTHON-2088 Define how multiple phases should be handled in SDAM spec runner
2020-02-24 16:32:09 -08:00