diff --git a/test/test_connection.py b/test/test_connection.py index 16fbc9b20..6fb3ed042 100644 --- a/test/test_connection.py +++ b/test/test_connection.py @@ -215,30 +215,6 @@ class TestConnection(unittest.TestCase): self.assertRaises(TypeError, iterate) - # TODO this test is probably very dependent on the machine its running on - # due to timing issues, but I want to get something in here. - def test_low_network_timeout(self): - c = None - i = 0 - n = 10 - while c is None and i < n: - try: - c = Connection(self.host, self.port, network_timeout=0.0001) - except AutoReconnect: - i += 1 - if i == n: - raise SkipTest() - - coll = c.pymongo_test.test - - for _ in range(1000): - try: - coll.find_one() - except AutoReconnect: - pass - except AssertionError: - self.fail() - def test_disconnect(self): c = Connection(self.host, self.port) coll = c.foo.bar diff --git a/test/test_threads.py b/test/test_threads.py index dcf98fdc3..96de72141 100644 --- a/test/test_threads.py +++ b/test/test_threads.py @@ -296,26 +296,6 @@ class BaseTestThreads(object): error.join() okay.join() - def test_low_network_timeout(self): - db = None - i = 0 - n = 10 - while db is None and i < n: - try: - db = get_connection(network_timeout=0.0001).pymongo_test - except AutoReconnect: - i += 1 - if i == n: - raise SkipTest() - - threads = [] - for _ in range(4): - t = IgnoreAutoReconnect(db.test, 100) - t.start() - threads.append(t) - - joinall(threads) - def test_server_disconnect(self): # PYTHON-345, we need to make sure that threads' request sockets are # closed by disconnect(). diff --git a/test/test_threads_replica_set_connection.py b/test/test_threads_replica_set_connection.py index 01701bb98..b363c7b32 100644 --- a/test/test_threads_replica_set_connection.py +++ b/test/test_threads_replica_set_connection.py @@ -48,52 +48,6 @@ class TestThreadsReplicaSet(TestConnectionReplicaSetBase, BaseTestThreads): """ return ReplicaSetConnection(pair, replicaSet=self.name) - def test_low_network_timeout(self): - """ - Override the similar test as TestThreads.test_low_connect_timeout(), - but use the newer connectTimeoutMS and socketTimeoutMS arguments instead - of the soon-to-be-deprecated network_timeout. - """ - db = None - n = 10 - - # First test connection timeout - i = 0 - while db is None and i < n: - try: - db = ReplicaSetConnection( - pair, - replicaSet=self.name, - connectTimeoutMS=1 - ).pymongo_test - except AutoReconnect: - i += 1 - if i == n: - raise SkipTest() - - # ... then test socket timeout - i = 0 - while db is None and i < n: - try: - db = ReplicaSetConnection( - pair, - replicaSet=self.name, - socketTimeoutMS=1 - ).pymongo_test - except AutoReconnect: - i += 1 - if i == n: - raise SkipTest() - - threads = [] - for _ in range(4): - t = IgnoreAutoReconnect(db.test, 100) - t.start() - threads.append(t) - - for t in threads: - t.join() - class TestThreadsAuthReplicaSet(TestConnectionReplicaSetBase, BaseTestThreadsAuth):