Commit Graph

92 Commits

Author SHA1 Message Date
Anthony Sottile
41be71f09f Trim trailing whitespace 2017-08-31 22:26:39 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
A. Jesse Jiryu Davis
a5c23a7520 Typo in test_ha. 2015-03-12 09:10:59 -04:00
A. Jesse Jiryu Davis
f757eb0433 Some unused imports in tests. 2015-03-11 21:56:44 -04:00
aherlihy
70c06d11a9 PYTHON-813 Removed client_knobs where no longer needed 2015-03-11 13:03:59 -07:00
aherlihy
fa1466179f PYTHON-813 Added support for serverSelectionTimeoutMS 2015-03-09 12:38:24 -07:00
A. Jesse Jiryu Davis
ea8ca5ec7d PYTHON-852 - Mongos load balancing.
The behavior for a list of mongoses is changed from "high availability" to
"load balancing". Before, the client connected to the lowest-latency mongos in
the list, and used it until a network error prompted it to re-evaluate all
mongoses' latencies and reconnect to one of them. In PyMongo 3, the client
monitors its network latency to all the mongoses continuously, and distributes
operations evenly among those with the lowest latency. See
high_availability.rst.
2015-03-08 08:25:13 -04:00
A. Jesse Jiryu Davis
329130712c Ease-of-use testing with ha_tools.py. 2015-03-08 08:24:35 -04:00
Bernie Hackett
3f3b6bedfc PYTHON-846 - Database.connection -> Database.client 2015-02-25 11:57:39 -08:00
Bernie Hackett
30af616009 PYTHON-821 - Migrate most tests to new the CRUD API. 2015-02-13 08:46:43 -08:00
A. Jesse Jiryu Davis
565e5faeb9 No more need to call MongoClient.close in tests. 2015-01-26 16:38:16 -05:00
A. Jesse Jiryu Davis
6cd00eee7f Use with-statement to flush test key-file. 2015-01-26 16:38:16 -05:00
A. Jesse Jiryu Davis
15c018655c Remove tearDowns from test_ha.
MongoClients now close themselves cleanly when garbage-collected. Dropping the database at the end of TestMongosHighAvailability isn't needed since the whole cluster will be destroyed.
2015-01-26 16:38:16 -05:00
A. Jesse Jiryu Davis
0a75f04384 Remove pre-MongoDB-2.0 version checks from tests. 2015-01-26 16:19:12 -05:00
Bernie Hackett
4e13a39db9 PYTHON-812 - Make local threshold global and immutable. 2015-01-08 11:21:54 -08:00
A. Jesse Jiryu Davis
108e97baad Unused imports in tests. 2014-12-10 14:11:33 -05:00
A. Jesse Jiryu Davis
3764d76dce PYTHON-785 Delete TestReplicaSetRequest. 2014-11-24 22:48:44 -05:00
A. Jesse Jiryu Davis
daad4446f8 Rename connection_id and conn_id to "address". 2014-11-18 17:40:34 -05:00
A. Jesse Jiryu Davis
0e222c4c4c Rename "set_name" to "replica_set_name".
Rename the attributes of IsMaster, ServerDescription, TopologyDescription, and
TopologySettings from "set_name" to "replica_set_name" for greater clarity.
2014-11-17 20:29:16 -05:00
A. Jesse Jiryu Davis
c554297a0f Modern exception-handling syntax in ha_tools.
Now that we've dropped support for Python 2.4.
2014-10-02 10:08:26 -04:00
A. Jesse Jiryu Davis
6004e2bcdd PYTHON-525 Use MongoClient in test_ha. 2014-09-25 16:36:36 -04:00
A. Jesse Jiryu Davis
28d40f5745 Redundant implementation of partition_node(). 2014-09-25 16:34:15 -04:00
A. Jesse Jiryu Davis
496e39faa2 Remove "itertools.permutations" backport. 2014-09-24 10:11:25 -04:00
A. Jesse Jiryu Davis
98afef5871 Replace "Cluster" term with "Topology".
The Server Discovery And Monitoring Spec has replaced the term "cluster"
with "topology", since "cluster" in MongoDB terminology should be reserved
for sharded clusters. "Topology" describes a single server, replica set, or a
set of mongoses.

The previous commit replaced "cluster" with "topology" in file names. Here
I replace the term in class and variable names.
2014-09-17 22:32:43 -04:00
A. Jesse Jiryu Davis
735a1247ca PYTHON-525 Deprecate MongoReplicaSetClient.
MongoClient now supports all MongoReplicaSetClient's features.
Fix bugs and add features in the new MongoClient to bring it up
to spec. MongoReplicaSetClient is now a deprecated stub that
subclasses MongoClient.

Introduce new errors, NetworkTimeout and NotMasterError, to
communicate events that MongoClient must handle specially.
2014-09-16 15:33:19 -04:00
A. Jesse Jiryu Davis
118b47e6e3 Unused imports. 2014-07-17 15:23:40 -04:00
A. Jesse Jiryu Davis
be5b4aeff9 PYTHON-724 Remove greenlet- and gevent-specific client tests. 2014-07-15 18:24:51 -04:00
A. Jesse Jiryu Davis
4ab4a979f8 PYTHON-724 Remove use_greenlets from high-availability tests. 2014-07-15 18:24:51 -04:00
A. Jesse Jiryu Davis
6f5b61cf81 More robust stepdown testing.
A 2.6 primary may not be ready to step down immediately after the RS
is initialized: "no secondaries within 10 seconds of optime". Keep
trying for a while.
2014-07-14 16:09:34 -04:00
Bernie Hackett
be35ff71a2 PYTHON-719 Read preference backward compatibility
This commit does a few things:

- Adds tag_sets back (deprecated)
- Adds secondary_acceptable_latency_ms back (deprecated)
- Makes acceptable latency a per read preference setting
- Cleans up read preference instance generation
- Adds latencyThresholdMS as an alias for secondaryAcceptableLatencyMS.
The name may change before 3.0 is released.
2014-06-27 15:05:20 -07:00
Luke Lovett
26fb43cf78 PYTHON-681 Reuse MongoClient whenever possible in the tests 2014-05-21 20:41:18 +00:00
Luke Lovett
141200083e PYTHON-680 Stop using nose in favor of pure unittest/unittest2 2014-04-25 22:57:33 +00:00
Luke Lovett
4d6d1e067b PYTHON-676 python 2/3 single-source for the test module 2014-04-23 18:37:02 +00:00
behackett
e0b52baf8e PYTHON-672 - Make read preference a class
This commit introduces the following changes:

- Each read preference is now a class.
- Read preferences other than Primary accept a tag_sets parameter.
- The tag_sets attribute of MongoClient, Database, and Collection has
  been removed. Use the tag_sets parameter of the new classes instead.
- The read_preferences.ReadPreference constant still exists and should
continue to work as expected for most users.
2014-04-14 16:28:07 -07:00
Bernie Hackett
2f86207246 PYTHON-526 secondaryAcceptableLatencyMS changes.
- Renamed to acceptableLatencyMS since it is also used
in choosing a new mongos during mongos HA failover.
- Moved to a global immutable setting. The expectation is
that the value would be determined by a network/system
admin. Changing it per operation doesn't make a lot of
sense.

Note - it's possible the name of this option may change again
before 3.0 is released.
2014-04-08 15:27:18 -07:00
Bernie Hackett
85db128efd PYTHON-526 Remove the "safe" option.
Use w=0 for unacknowledged write operations.
2014-04-04 17:15:50 -07:00
Bernie Hackett
48a65eb9c1 PYTHON-526 Drop support for slaveOk/slave_okay.
Use any ReadPreference other than PRIMARY instead.
2014-04-04 16:37:32 -07:00
A. Jesse Jiryu Davis
9f7580fd61 More robust test_read_preference. 2014-04-03 09:45:54 -04:00
A. Jesse Jiryu Davis
cb101acb29 Fix race in test_request_during_failover. 2014-04-02 21:16:10 -04:00
A. Jesse Jiryu Davis
f6a0686583 Fix TestHealthMonitor.test_primary_stepdown. 2014-04-02 21:16:10 -04:00
A. Jesse Jiryu Davis
4915a15218 Fix test_ship_of_theseus. 2014-04-02 17:17:16 -04:00
Luke Lovett
da40fb0ddc test interaction of w, j, and fsync options test for getLastErrorDefaults interaction 2014-03-09 18:22:45 -07:00
A. Jesse Jiryu Davis
2fa1750b07 Update copyright notices and company name. 2014-01-31 09:36:46 -05:00
A. Jesse Jiryu Davis
01d4f931c5 Be less patient waiting for replica set to initiate in test_ha. 2013-12-07 14:26:56 -05:00
A. Jesse Jiryu Davis
04a45cbf74 Clarification in test_ha. 2013-12-07 14:26:56 -05:00
A. Jesse Jiryu Davis
c542fa368e RS client remembers the host list from last ismaster response, uses it like a seed list if current hosts are unreachable, PYTHON-600. 2013-12-07 14:26:56 -05:00
A. Jesse Jiryu Davis
8f6a34326e Improve multithreaded connection and reconnection in MongoClient, PYTHON-487. 2013-12-04 21:09:15 -05:00
A. Jesse Jiryu Davis
caf83b4e02 Fix TestShipOfTheseus when use_greenlets=True. 2013-11-28 11:36:49 -05:00
A. Jesse Jiryu Davis
80290241a4 Python 2.4 compatibility in test_ha. 2013-11-26 22:55:45 -05:00
A. Jesse Jiryu Davis
3634836ea0 Avoid the only-briefly-supported Exception.message attribute in ha_tools 2013-11-26 20:46:47 -05:00