|
36 | 36 | from pymongo.server_selectors import (any_server_selector, |
37 | 37 | writable_server_selector) |
38 | 38 | from pymongo.settings import TopologySettings |
39 | | -from test import client_knobs, SkipTest, unittest |
| 39 | +from test import client_knobs, unittest |
40 | 40 | from test.utils import wait_until |
41 | 41 |
|
42 | 42 |
|
@@ -574,30 +574,6 @@ def _check_with_socket(self, sock_info): |
574 | 574 | self.assertEqual(3, ismaster_count[0]) |
575 | 575 | self.assertEqual(SERVER_TYPE.Standalone, get_type(t, 'a')) |
576 | 576 |
|
577 | | - def test_selection_failure(self): |
578 | | - if sys.platform == 'win32': |
579 | | - raise SkipTest('timing unreliable on Windows') |
580 | | - |
581 | | - # While ismaster fails, ensure it's called about every 10 ms. |
582 | | - ismaster_count = [0] |
583 | | - |
584 | | - class TestMonitor(Monitor): |
585 | | - def _check_with_socket(self, sock_info): |
586 | | - ismaster_count[0] += 1 |
587 | | - raise socket.error('my error') |
588 | | - |
589 | | - t = create_mock_topology(monitor_class=TestMonitor) |
590 | | - |
591 | | - with self.assertRaisesRegex(ConnectionFailure, 'my error'): |
592 | | - # Add slop to prevent rounding error. |
593 | | - t.select_servers(any_server_selector, |
594 | | - server_selection_timeout=0.5) |
595 | | - |
596 | | - self.assertTrue( |
597 | | - 25 <= ismaster_count[0] <= 100, |
598 | | - "Expected ismaster to be attempted about 50 times, not %d" % |
599 | | - ismaster_count[0]) |
600 | | - |
601 | 577 | def test_internal_monitor_error(self): |
602 | 578 | exception = AssertionError('internal error') |
603 | 579 |
|
|
0 commit comments