Commit Graph

19 Commits

Author SHA1 Message Date
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
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
7c13667727 PYTHON-1898 Close events executor faster after the topology is freed 2019-07-26 12:51:35 -07:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
Bernie Hackett
e89ba4bcd0 PYTHON-1026 - Remove test assumption about primary host 2016-09-21 11:15:43 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
A. Jesse Jiryu Davis
e8c03d65a7 Python 2 compatibility in TestMonitor.test_atexit_hook. 2015-01-12 21:04:07 -05:00
A. Jesse Jiryu Davis
b633af82a9 Simplify TestMonitor.
The executor is now registered immediately, don't need to wait.
2015-01-12 18:03:15 -05:00
A. Jesse Jiryu Davis
9d9b65e2c2 Shorter timeout in TestMonitor.
Make false negative (test passes but shouldn't) less likely.
2015-01-12 18:03:15 -05:00
A. Jesse Jiryu Davis
f0daebf4bb PYTHON-799 Create a PeriodicExecutor class for background monitoring.
The executor will also be used to solve a deadlock in Cursor.__del__.
2014-12-17 13:19:05 -05:00
A. Jesse Jiryu Davis
5991635553 Unused imports in test files. 2014-11-17 16:15:12 -05:00
A. Jesse Jiryu Davis
21976d9976 Monitors stop themselves when the Topology is GC'ed. 2014-11-03 14:40:06 -05:00
A. Jesse Jiryu Davis
38848d47f3 MongoClient.close() stops monitors.
Subsequent operations restart them.
2014-11-03 14:40:06 -05:00
A. Jesse Jiryu Davis
7fb570d334 test_atexit_hook wasn't testing what it meant to. 2014-10-31 16:10:13 -04:00
A. Jesse Jiryu Davis
0a246d2033 Standardize how tests construct MongoClients. 2014-10-30 19:36:59 -04:00
A. Jesse Jiryu Davis
6b6f61f26c Fix TestMonitor.test_atexit_hook. 2014-09-26 21:31:56 -04:00
A. Jesse Jiryu Davis
fdd93a1d78 Debug TestMonitor.test_atexit_hook. 2014-09-26 09:26:07 -04:00
A. Jesse Jiryu Davis
fea501f314 PYTHON-525 Try to halt monitors before exiting. 2014-09-24 19:12:30 -04:00