Add more retries to TestMigrateFromDownHost tests
We still having occasional failures in TestMigrateFromDownHost tests where the compute is not observed down after stopping the service. There was a fix I61fded6f513c18dbd0248ed54fc58a318dc05416 that increased the CONF.service_down_time to 6 seconds. However the _wait_for_service_parameter() helper by default uses 10 retries with 0.5 sec delays. This can be pretty close to the 6 seconds of service timeout. This patch increase the number of retires to 20 avoid unstable test runs. Change-Id: Iad970fa3aa10aaa2c831a064c085c06fdc88305e Closes-Bug: #1940741
This commit is contained in:
parent
402fe188b4
commit
058d137ac8
|
@ -72,13 +72,16 @@ class TestMigrateFromDownHost(integrated_helpers._IntegratedTestBase):
|
|||
source_compute_id = self.api.get_services(
|
||||
host='src', binary='nova-compute')[0]['id']
|
||||
self.api.put_service(source_compute_id, {'forced_down': 'true'})
|
||||
# NOTE(gibi): extra retries are needed as the default 10 retries with
|
||||
# 0.5 second sleep is close to the 6 seconds down timeout
|
||||
self._wait_for_service_parameter(
|
||||
'src', 'nova-compute',
|
||||
{
|
||||
'forced_down': True,
|
||||
'state': 'down',
|
||||
'status': 'enabled'
|
||||
}
|
||||
},
|
||||
max_retries=20,
|
||||
)
|
||||
|
||||
# Assert that we cannot migrate from a forced down compute
|
||||
|
@ -94,12 +97,15 @@ class TestMigrateFromDownHost(integrated_helpers._IntegratedTestBase):
|
|||
|
||||
# Stop the compute service and wait until it's down
|
||||
self.computes['src'].stop()
|
||||
# NOTE(gibi): extra retries are needed as the default 10 retries with
|
||||
# 0.5 second sleep is close to the 6 seconds down timeout
|
||||
self._wait_for_service_parameter(
|
||||
'src', 'nova-compute',
|
||||
{
|
||||
'state': 'down',
|
||||
'status': 'enabled'
|
||||
}
|
||||
},
|
||||
max_retries=20,
|
||||
)
|
||||
|
||||
# Assert that requests to migrate from down computes are rejected
|
||||
|
@ -123,8 +129,10 @@ class TestMigrateFromDownHost(integrated_helpers._IntegratedTestBase):
|
|||
|
||||
# Stop the compute service and wait until it's down
|
||||
self.computes['src'].stop()
|
||||
# NOTE(gibi): extra retries are needed as the default 10 retries with
|
||||
# 0.5 second sleep is close to the 6 seconds down timeout
|
||||
self._wait_for_service_parameter(
|
||||
'src', 'nova-compute', {'state': 'down'})
|
||||
'src', 'nova-compute', {'state': 'down'}, max_retries=20)
|
||||
|
||||
ex = self.assertRaises(
|
||||
client.OpenStackApiException, self.api.post_server_action,
|
||||
|
|
Loading…
Reference in New Issue