Allow introspection some time to start in ironic-inspector
We expect introspection to start immediately after issuing "inspect" action to ironic. In reality, it can take a few seconds, so wait up to 90 seconds (by default). Change-Id: If6c23e139d7d7bcadd416b6228c16a5fb4975c48
This commit is contained in:
parent
ed09bccbae
commit
deab6ec41d
|
@ -178,6 +178,9 @@ BaremetalIntrospectionGroup = [
|
||||||
cfg.IntOpt('introspection_timeout',
|
cfg.IntOpt('introspection_timeout',
|
||||||
default=600,
|
default=600,
|
||||||
help="Introspection time out"),
|
help="Introspection time out"),
|
||||||
|
cfg.IntOpt('introspection_start_timeout',
|
||||||
|
default=90,
|
||||||
|
help="Timeout to start introspection"),
|
||||||
cfg.IntOpt('hypervisor_update_sleep',
|
cfg.IntOpt('hypervisor_update_sleep',
|
||||||
default=60,
|
default=60,
|
||||||
help="Time to wait until nova becomes aware of "
|
help="Time to wait until nova becomes aware of "
|
||||||
|
|
|
@ -177,11 +177,24 @@ class InspectorScenarioTest(BaremetalScenarioTest):
|
||||||
node_ids = [node_ids]
|
node_ids = [node_ids]
|
||||||
start = int(time.time())
|
start = int(time.time())
|
||||||
not_introspected = {node_id for node_id in node_ids}
|
not_introspected = {node_id for node_id in node_ids}
|
||||||
|
introspection_start_timeout = (
|
||||||
|
CONF.baremetal_introspection.introspection_start_timeout)
|
||||||
|
|
||||||
while not_introspected:
|
while not_introspected:
|
||||||
time.sleep(CONF.baremetal_introspection.introspection_sleep)
|
time.sleep(CONF.baremetal_introspection.introspection_sleep)
|
||||||
for node_id in node_ids:
|
for node_id in node_ids:
|
||||||
status = self.introspection_status(node_id)
|
try:
|
||||||
|
status = self.introspection_status(node_id)
|
||||||
|
except lib_exc.NotFound as exc:
|
||||||
|
if int(time.time()) - start >= introspection_start_timeout:
|
||||||
|
message = ('Node %(node_id)s did not appear in the '
|
||||||
|
'baremetal introspection API after '
|
||||||
|
'%(timeout)d seconds: %(error)s' %
|
||||||
|
{'node_id': node_id, 'error': exc,
|
||||||
|
'timeout': introspection_start_timeout})
|
||||||
|
raise exceptions.IntrospectionFailed(message)
|
||||||
|
else:
|
||||||
|
continue
|
||||||
if status['finished']:
|
if status['finished']:
|
||||||
if status['error']:
|
if status['error']:
|
||||||
message = ('Node %(node_id)s introspection failed '
|
message = ('Node %(node_id)s introspection failed '
|
||||||
|
|
Loading…
Reference in New Issue