From af2c2a6eb54d848eefc2d0a1b619e0b86eed2eb5 Mon Sep 17 00:00:00 2001 From: Samuel Merritt Date: Thu, 21 Dec 2017 10:43:39 -0800 Subject: [PATCH] Fix sometimes-flaky container name functional test. You've got two test classes: TestContainer and TestContainerUTF8. They each try to create the same set of containers with names of varying lengths to make sure the container-name length limit is being honored. Also, each test class tries to clean up pre-existing data in its setUpClass method. If TestContainerUTF8 fails to delete a contaienr that TestContainer made, then its testContainerNameLimit method will fail because the container PUT response has status 202 instead of 201, which is because the container still existed from the prior test. I've made the test consider both 201 and 202 as success. For purposes of testing the maximum container name length, any 2xx is fine. Change-Id: I7b343a8ed0d12537659c051ddf29226cefa78a8f --- test/functional/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/functional/tests.py b/test/functional/tests.py index d090c47533..6c28bbef04 100644 --- a/test/functional/tests.py +++ b/test/functional/tests.py @@ -534,7 +534,7 @@ class TestContainer(Base): cont = self.env.account.container('a' * l) if l <= limit: self.assertTrue(cont.create()) - self.assert_status(201) + self.assert_status((201, 202)) else: self.assertFalse(cont.create()) self.assert_status(400)