More tests for 404 handoff skipping
Sometimes we want 404, sometimes we want 503 - it's tricky Change-Id: I30f5af07e2e1fc7cbb6bdb1c334a0a161caf0906 Related-Change-Id: I53ed04b5de20c261ddd79c98c629580472e09961
This commit is contained in:
parent
563e1671cf
commit
044c919871
@ -348,6 +348,7 @@ class TestContainerController(TestRingBase):
|
||||
([Timeout()] * (nodes + handoffs), 503),
|
||||
([Timeout()] * (nodes + handoffs - 1) + [404], 503),
|
||||
([Timeout()] * (nodes - 1) + [404] * (handoffs + 1), 404),
|
||||
([500] * (nodes - 1) + [404] * (handoffs + 1), 503),
|
||||
([503, 200], 200),
|
||||
([507, 200], 200),
|
||||
]
|
||||
@ -378,6 +379,16 @@ class TestContainerController(TestRingBase):
|
||||
resp = req.get_response(self.app)
|
||||
self.assertEqual(resp.status_int, 503)
|
||||
|
||||
def test_handoff_has_deleted_database(self):
|
||||
nodes = self.app.container_ring.replicas
|
||||
handoffs = self.app.request_node_count(nodes) - nodes
|
||||
status = [Timeout()] * nodes + [404] * handoffs
|
||||
timestamps = tuple([None] * nodes + ['1'] + [None] * (handoffs - 1))
|
||||
with mocked_http_conn(*status, timestamps=timestamps):
|
||||
req = Request.blank('/v1/a/c')
|
||||
resp = req.get_response(self.app)
|
||||
self.assertEqual(resp.status_int, 404)
|
||||
|
||||
def test_response_code_for_PUT(self):
|
||||
PUT_TEST_CASES = [
|
||||
((201, 201, 201), 201),
|
||||
|
Loading…
x
Reference in New Issue
Block a user