From 151313ba8c6612183f6a733edbcbc311b3360949 Mon Sep 17 00:00:00 2001 From: Samuel Merritt Date: Wed, 3 Jul 2013 17:45:20 -0700 Subject: [PATCH] Fix flaky test. test_DELETE_x_container_headers_with_more_container_replicas() would sometimes fail, and it's because a test helper method was defaulting to sorting the captured headers by X-Container-Partition. Well, in tests we use FakeRing, and the partition is always 1, so that sorting didn't buy us much. Now the sorting is done by X-Container-Device, which actually differs meaningfully. Change-Id: Ibe5b2fcd3f23280ed2caaa703111a98861331866 --- test/unit/proxy/test_server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/proxy/test_server.py b/test/unit/proxy/test_server.py index 962cece739..a5a3671630 100644 --- a/test/unit/proxy/test_server.py +++ b/test/unit/proxy/test_server.py @@ -4519,9 +4519,9 @@ class TestObjectController(unittest.TestCase): def _gather_x_container_headers(self, controller_call, req, *connect_args, **kwargs): - header_list = kwargs.pop('header_list', ['X-Container-Partition', + header_list = kwargs.pop('header_list', ['X-Container-Device', 'X-Container-Host', - 'X-Container-Device']) + 'X-Container-Partition']) seen_headers = [] def capture_headers(ipaddr, port, device, partition, method, @@ -4542,7 +4542,7 @@ class TestObjectController(unittest.TestCase): # don't care about the account/container HEADs, so chuck # the first two requests return sorted(seen_headers[2:], - key=lambda d: d.get(header_list[0]) or 'Z') + key=lambda d: d.get(header_list[0]) or 'z') def test_PUT_x_container_headers_with_equal_replicas(self): req = Request.blank('/a/c/o', environ={'REQUEST_METHOD': 'PUT'},