Commit Graph

44 Commits

Author SHA1 Message Date
Noah Stapp
1b3dea3f03
PYTHON-4533 - Convert test/test_transactions.py to async (#1732) 2024-07-15 16:45:59 -07: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
Steven Silvester
992d1507e7
PYTHON-4005 Replace flake8 and isort with ruff (#1399) 2023-10-19 11:56:22 -05:00
Shane Harvey
1ad0df0858
PYTHON-3724 Remove null values from command_started_event in fle2v2-CreateCollection.yml (#1223) 2023-06-06 12:06:08 -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
deb0566c3e
PYTHON-3614 Support Queryable Encryption protocol v2 on 7.0+ (#1197)
Resync FLE spec tests and update docs for new QE protocol on 7.0.
Add client side error for createEncryptedCollection on MongoDB < 7.0.
KMS timeout errors should always have exc.timeout==True.
PYTHON-3583 Drivers should not create the ECC collection in v2 of queryable encryption.
2023-05-01 09:16:28 -07:00
Shane Harvey
c0dd24e4a7
PYTHON-3609 Stop using deprecated setDaemon api in test suite (#1158) 2023-02-16 15:49:00 -08:00
Shane Harvey
79aa5e6757
PYTHON-3516 Improve test EventListener api (#1114) 2022-11-14 08:50:08 -08:00
Julius Park
484374eb3f
PYTHON-3298 Add flag to create_collection to skip listCollections pre-check (#1006) 2022-07-18 13:40:16 -07:00
Julius Park
6b088ffa4e
PYTHON-3241 Add Queryable Encryption API to AutoEncryptionOpts (#957) 2022-06-06 12:33:31 -04:00
Shane Harvey
ede07f44dd
PYTHON-3250 Speed up majority writes in test suite (#936) 2022-05-03 14:41:24 -07: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
e27131546c
PYTHON-2998 Remove md5 checksums from gridfs and remove disable_md5 (#776)
Speed up gridfs tests (shaves off about 2 minutes on macOS).
2021-11-04 17:25:11 -07:00
Shane Harvey
968ee7ba96
PYTHON-2868 Test Serverless behind a load balancer (#742) 2021-09-23 15:57:57 -07:00
Shane Harvey
d559b28efb
PYTHON-2905 Fix CSFLE after UUID decoding changes (#732) 2021-09-16 17:50:22 -07:00
Shane Harvey
65aa7c86d5
PYTHON-2850 Remove map_reduce/inline_map_reduce (#703) 2021-08-12 09:44:52 -07:00
Shane Harvey
e1b068d37a
PYTHON-2525 Remove Collection.count and Cursor.count (#700) 2021-08-10 13:52:29 -07:00
Shane Harvey
b4b7a07b81
PYTHON-2762 Avoid duplicating unified test files for LB testing (#649)
Create new client for each cursor/session __del__ test.
Always close cursors in spec tests.
2021-06-25 16:20:21 -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
Bernie Hackett
a72e8b8823 PYTHON-2133 Remove py2 support from test
Also delete bson/py3compat.py
2021-01-20 09:40:36 -08:00
Prashant Mital
6b0123594a
PYTHON-2033 Unified Test Format (#519) 2020-12-21 19:22:29 -08:00
Prashant Mital
c673d8b3ce
PYTHON-2318 Atlas Data Lake testing (#500) 2020-12-17 13:58:03 -08:00
Shane Harvey
d1fd3f7e98
PYTHON-2363 Rate limit new connection creations via maxConnecting (#511)
At most 2 connections can be in the pending state per connection pool.
The pending state covers all the work required to setup a new connection
including TCP, TLS, and MongoDB authentication. For example, if two
threads are currently creating connections, a third thread will wait for
either an existing connection to be checked back into the pool or for
one of the two threads to finish creating a connection.

The change reduces the likelihood of connection storms and improves the
driver's ability to reuse existing connections.
2020-11-23 15:55:54 -08: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
Shane Harvey
fb7533e888 PYTHON-2099 Make ExceededTimeLimit a retryable writes error
Reinstate DuplicateKey code assertions.
2020-05-12 14:41:11 -07:00
Shane Harvey
9f8468f309 PYTHON-2037 Test operations omit default write concern 2020-05-08 17:48:07 -07:00
Shane Harvey
5d8e814e58 PYTHON-2237 Use sort when verifying contents of outcome collections 2020-05-08 14:24:20 -07:00
Shane Harvey
fd64f4dd64 PYTHON-2030 Support collection and index creation in multi-doc transactions 2020-04-02 12:20:50 -07:00
Prashant Mital
b65fdf3f51
PYTHON-2142 Add index hinting support to delete operations 2020-03-26 16:01:33 -07:00
Prashant Mital
1323ef15cb
PYTHON-2036 Expand CRUD API support for index hinting (also PYTHON-2015, PYTHON-2104, PYTHON-2134) 2020-02-25 19:22:25 -08:00
Prashant Mital
ed4204f237
PYTHON-1954 Stop holding the topology lock while creating new connections 2019-12-05 09:58:58 +05:30
Shane Harvey
6f00a240c7 PYTHON-1955 Test encryption in evergreen
Only enable xtrace output for non-sensitive tasks.
2019-08-13 09:07:42 -07:00
Prashant Mital
78aa667f0f
PYTHON-1934 retryWrites=True with MMAPv1 storage engine should raise an actionable error 2019-08-08 13:24:46 -07:00
Shane Harvey
e6eecb06d1 PYTHON-1884 Implement auto encryption spec tests
Skip test for symbol type which pymongo converts to string.
Fix {} comparison with RawBSONDocument in command events.
Add support for $$type assertions.
Nicer message in check_events.
Support errorContains with empty string.
Move custom data files to custom/.
2019-08-06 16:17:39 -07:00
Bernie Hackett
8f0ea1daec PYTHON-1797 PYTHON-1659 Update retryWrites tests 2019-07-15 17:33:51 -07:00
Prashant Mital
81529713ba
PYTHON-1699 Add database level aggregate helper 2019-06-12 16:37:39 -07:00
Shane Harvey
4170d8ac7f PYTHON-1829 Support maxTimeMS for commitTransaction
Add max_commit_time_ms to TransactionOptions.
MaxTimeMSExpired errors on commit are labelled UnknownTransactionCommitResult.
with_transaction does not retry commit after MaxTimeMSExpired errors.
2019-06-04 15:44:32 -07:00
Shane Harvey
fc645a248e PYTHON-1838 Discard ServerSessions involved in network errors 2019-06-04 15:43:55 -07:00
Shane Harvey
ff689253f8 PYTHON-1831 Refactor CRUD v2 to use base SpecRunner class 2019-04-30 11:02:09 -07:00
Shane Harvey
086b600d62 PYTHON-1831 Fix spec test parsing of returnDocument argument 2019-04-29 15:55:26 -07:00
Shane Harvey
a15266083b PYTHON-1674 Support retryable reads
Add retryReads URI option that defaults to True.
Supported read operations will be retried once after transient
network, election, and shutdown errors on MongoDB 3.6+.
Supported operations are:
listCollections, listIndexes, and listDatabases
distinct
count, estimated_document_count, count_documents
aggregate (not including $out)
find (only for the initial find command, getMore commands are not
retried).
ChangeStreams: watch (initial aggregate command).
GridFS read APIs.

Test changes:
Add retryable reads spec test runner.
Disable retryable reads in network error tests.
2019-04-25 14:28:12 -07:00
Shane Harvey
87951c33f8 PYTHON-1674 Refactor spec test runner for transactions
This enables us to reuse the transaction spec runner for tesing
retryable reads.
2019-04-25 14:27:41 -07:00