Commit Graph

144 Commits

Author SHA1 Message Date
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
c5652336ef
PYTHON-3671 Use default server selection timeout in test setup (#1191) 2023-04-14 14:45:57 -07:00
Julius Park
92e6150d84
PYTHON-3493 Bulk Write InsertOne Should Be Parameter Of Collection Type (#1106) 2022-11-10 14:19:55 -08:00
Julius Park
9083821300
PYTHON-3454 Specifying a generic type for a collection does not correctly enforce type safety when inserting data (#1081) 2022-11-01 14:33:21 -07:00
Shane Harvey
179efda312
PYTHON-3406 Reinstate warning and docs that PyMongo is not fork safe (#1050)
Log child process C-level stacks when fork tests deadlock.
Encode hostname to bytes to avoid getaddrinfo importlib deadlock.
2022-09-13 14:14:53 -07:00
Shane Harvey
1e6b4a48d4
PYTHON-3406 Log traceback when fork() test encounters a deadlock (#1045)
Co-authored-by: Ben Warner <ben.warner@mongodb.com>
2022-08-22 14:16:27 -07:00
Shane Harvey
7f19186cac
PYTHON-3406 Refactor fork tests to print traceback on failure (#1042) 2022-08-18 17:06:02 -07:00
Shane Harvey
5b85ad2bcf
PYTHON-3391 Skip unsupported CSOT tests on serverless (#1030) 2022-08-03 13:30:41 -07:00
Steven Silvester
b37b146ac8
PYTHON-3053 Key Management API (#958) 2022-06-30 12:35:29 -05:00
Shane Harvey
ede07f44dd
PYTHON-3250 Speed up majority writes in test suite (#936) 2022-05-03 14:41:24 -07:00
Shane Harvey
1d6914f749
PYTHON-3191 Fix test_sigstop_sigcont with Versioned API (#916) 2022-03-31 12:25:45 -07:00
Shane Harvey
c58950a8d4
PYTHON-3186 Avoid SDAM heartbeat timeouts on AWS Lambda (#912)
Poll monitor socket with timeout=0 one last time after timeout expires.
This avoids heartbeat timeouts and connection churn on Lambda and other FaaS envs.
2022-03-30 14:29:46 -07:00
Shane Harvey
9ada6543d5
PYTHON-3174 Remove noisy running Topology check for main test client (#898) 2022-03-15 14:52:47 -07:00
Julius Park
f5eec45250
PYTHON-3111 Rename "Versioned API" to "Stable API" in documentation (#867) 2022-02-17 16:23:23 -08:00
Steven Silvester
a0fe7c03af
PYTHON-3120 Set up flake8 linting (#868) 2022-02-17 06:44:08 -06:00
Julius Park
341d489f38
PYTHON-3088 Update load balancer tests to support dedicated load balancer port (#866) 2022-02-14 11:26:14 -08: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
8b2eb24c35
PYTHON-2164 Remove client max_bson_size/max_message_size/max_write_batch_size (#766)
Use the hello command instead:
doc = client.admin.command('hello')
max_bson_size = doc['maxBsonObjectSize']
max_message_size = doc['maxMessageSizeBytes']
max_write_batch_size = doc['maxWriteBatchSize']

Also add documentation for TopologyDescription.apply_selector.
2021-11-01 14:26:47 -07:00
Shane Harvey
968ee7ba96
PYTHON-2868 Test Serverless behind a load balancer (#742) 2021-09-23 15:57:57 -07:00
Shane Harvey
11752ed594
PYTHON-2899 Remove code for MongoDB <= 3.4 (#729)
Remove unneeded memoryview to bytes conversion.
2021-09-16 16:53:50 -07: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
b3118e034e
PYTHON-2162 Remove support for ssl* URI options (#706) 2021-08-19 14:58:31 -07:00
Shane Harvey
6a18027db8
PYTHON-2534 Avoid race in test_pool_paused_error_is_retryable (#704) 2021-08-16 10:27:37 -07:00
Shane Harvey
f541e7731c
PYTHON-2602 Test that pool paused errors are retryable (#681)
Allow client_knobs to be used as a decorator.
2021-07-30 17:56:01 -07:00
Prashant Mital
f07da34f97
PYTHON-2545 Test Atlas Serverless (#664) 2021-07-27 16:35:09 -07:00
Shane Harvey
6d1ebf4597
PYTHON-2798 Workaround windows cert issue with SSL_CERT_FILE (#670) 2021-07-12 14:17:01 -07:00
Prashant Mital
00ed2321ba
PYTHON-2475 Implement Atlas Data Lake prose specification tests (#665)
* PYTHON-2475 Add prose specification tests for Atlas Data Lake

* add prose tests

* Update evergreen config to bootstrap ADL

* add sleep before connecting to ADL

* print buildinfo

* print buildInfo in conditional block

* refactor skiplogic

* remove sleep

* fix debugging code

* Ensure ADL tests run

* ensure suite fails if not connected

* fix test failure

* improve data_lake variable extraction

* review changes
2021-07-07 23:55:52 -07:00
Shane Harvey
354c96a414
PYTHON-2779 Fix topologies field in snapshot reads test (#657) 2021-06-28 15:11:52 -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
6bc5e088af
PYTHON-1272 Fix deadlock when garbage collecting pinned cursors and sessions (#642)
It's not safe to return the pinned connection to the pool from within
Cursor.del because the Pool's lock may be held by a python thread
while the cyclic garbage collector runs. Instead we send the cursor
cleanup request to the client's background thread. The thread will
send killCursors on the pinned socket and then return the socket to
the pool.
Also fixed a similar bug when garbage collecting a pinned session.
2021-06-22 17:29:26 -07:00
Shane Harvey
bf78a9b2ef
PYTHON-2744 Run LB tests against non-LB clusters (#638)
Fix serviceId fallback to make spec test pass.
Fix socket leak when SocketInfo connection handshake fails.
2021-06-15 14:30:01 -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
2a74601572
PYTHON-2676 Unified Test Runner changes in preparation for Load Balancer Support (#623)
Resync crud, change stream, SDAM, server_selection, transactions, uri-options, tests.
PYTHON-2348 Correctly express lack of event assertions in change stream tests.
2021-05-18 10:20:36 -07:00
Shane Harvey
2c41c6fe95
PYTHON-2671 Support loadBalanced URI option (#614)
Add workaround in test_dns until PYTHON-2679 is completed.
2021-05-05 12:51:05 -07:00
Shane Harvey
95974617bd
PYTHON-1314 Remove Database.authenticate and Database.logout (#568) 2021-02-17 14:16:07 -08:00
Shane Harvey
c65b89d8a1
PYTHON-1319 Remove Collection.ensure_index and reindex (#555) 2021-01-21 11:25:19 -08:00
Shane Harvey
06924cb00b
PYTHON-2489 Fix "no server" test suite, fix unified test runCommand (#543) 2021-01-13 14:29:58 -08:00
Shane Harvey
ac2f506ba2
PYTHON-2453 Add MongoDB Versioned API (#536)
Add pymongo.server_api.ServerApi and the MongoClient server_api option.
Support Unified Test Format version 1.1 (serverParameters in
runOnRequirements)
Skip dropRole tests due to SERVER-53499.
2021-01-11 18:16:00 -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
Prashant Mital
6b0123594a
PYTHON-2033 Unified Test Format (#519) 2020-12-21 19:22:29 -08:00
Shane Harvey
2eecf525d9
PYTHON-2474 Fix non-disabled client_knobs bug in Data Lake tests (#537) 2020-12-21 15:54:02 -10:00
Prashant Mital
c673d8b3ce
PYTHON-2318 Atlas Data Lake testing (#500) 2020-12-17 13:58:03 -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
84fd04ec6d
PYTHON-1852 Use TLS option names in test suite ClientContext (#442) 2020-06-18 18:24:08 -07:00
Prashant Mital
74202455aa
PYTHON-2278 Fix Jython SDAM test failures 2020-06-16 15:55:21 -07:00
Shane Harvey
5b49557c59 PYTHON-2268 Close clients in test suite 2020-06-03 17:05:59 -07:00
Shane Harvey
33c93223b1 PYTHON-1651 Publish CommandFailedEvent when bulk write fails with a network error 2020-05-12 14:42:27 -07:00
Prashant Mital
4398b4b7da
PYTHON-2201 Deprecate the Collection.reindex method 2020-04-21 18:23:51 -07:00