Show More
@@ -156,16 +156,24 b' class TestLoadBalancedView(ClusterTestCase):' | |||||
156 |
|
156 | |||
157 | def test_retries(self): |
|
157 | def test_retries(self): | |
158 | view = self.view |
|
158 | view = self.view | |
159 | view.timeout = 1 # prevent hang if this doesn't behave |
|
|||
160 | def fail(): |
|
159 | def fail(): | |
161 | assert False |
|
160 | assert False | |
162 | for r in range(len(self.client)-1): |
|
161 | for r in range(len(self.client)-1): | |
163 | with view.temp_flags(retries=r): |
|
162 | with view.temp_flags(retries=r): | |
164 | self.assertRaisesRemote(AssertionError, view.apply_sync, fail) |
|
163 | self.assertRaisesRemote(AssertionError, view.apply_sync, fail) | |
165 |
|
164 | |||
166 |
with view.temp_flags(retries=len(self.client), timeout=0. |
|
165 | with view.temp_flags(retries=len(self.client), timeout=0.1): | |
167 | self.assertRaisesRemote(error.TaskTimeout, view.apply_sync, fail) |
|
166 | self.assertRaisesRemote(error.TaskTimeout, view.apply_sync, fail) | |
168 |
|
167 | |||
|
168 | def test_short_timeout(self): | |||
|
169 | view = self.view | |||
|
170 | def fail(): | |||
|
171 | import time | |||
|
172 | time.sleep(0.25) | |||
|
173 | assert False | |||
|
174 | with view.temp_flags(retries=1, timeout=0.01): | |||
|
175 | self.assertRaisesRemote(AssertionError, view.apply_sync, fail) | |||
|
176 | ||||
169 | def test_invalid_dependency(self): |
|
177 | def test_invalid_dependency(self): | |
170 | view = self.view |
|
178 | view = self.view | |
171 | with view.temp_flags(after='12345'): |
|
179 | with view.temp_flags(after='12345'): |
General Comments 0
You need to be logged in to leave comments.
Login now