Merge "workaround probetest race from early response"
This commit is contained in:
commit
053bdd4f8b
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
import time
|
||||||
|
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
from unittest import main, TestCase
|
from unittest import main, TestCase
|
||||||
@ -104,14 +105,24 @@ class TestEmptyDevice(TestCase):
|
|||||||
client.get_container(self.url, self.token, container)[1]]
|
client.get_container(self.url, self.token, container)[1]]
|
||||||
if obj not in objs:
|
if obj not in objs:
|
||||||
raise Exception('Container listing did not know about object')
|
raise Exception('Container listing did not know about object')
|
||||||
for cnode in cnodes:
|
timeout = time.time() + 5
|
||||||
objs = [o['name'] for o in
|
found_objs_on_cnode = []
|
||||||
direct_client.direct_get_container(
|
while time.time() < timeout:
|
||||||
cnode, cpart, self.account, container)[1]]
|
for cnode in [c for c in cnodes if cnodes not in
|
||||||
if obj not in objs:
|
found_objs_on_cnode]:
|
||||||
raise Exception(
|
objs = [o['name'] for o in
|
||||||
'Container server %s:%s did not know about object' %
|
direct_client.direct_get_container(
|
||||||
(cnode['ip'], cnode['port']))
|
cnode, cpart, self.account, container)[1]]
|
||||||
|
if obj in objs:
|
||||||
|
found_objs_on_cnode.append(cnode)
|
||||||
|
if len(found_objs_on_cnode) >= len(cnodes):
|
||||||
|
break
|
||||||
|
time.sleep(0.3)
|
||||||
|
if len(found_objs_on_cnode) < len(cnodes):
|
||||||
|
missing = ['%s:%s' % (cnode['ip'], cnode['port']) for cnode in
|
||||||
|
cnodes if cnode not in found_objs_on_cnode]
|
||||||
|
raise Exception('Container servers %r did not know about object' %
|
||||||
|
missing)
|
||||||
start_server(onode['port'], self.port2server, self.pids)
|
start_server(onode['port'], self.port2server, self.pids)
|
||||||
self.assertFalse(os.path.exists(obj_dir))
|
self.assertFalse(os.path.exists(obj_dir))
|
||||||
exc = None
|
exc = None
|
||||||
|
Loading…
Reference in New Issue
Block a user