Skip to content

Commit 058d137

Browse files
author
Balazs Gibizer
committed
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
1 parent 402fe18 commit 058d137

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

nova/tests/functional/regressions/test_bug_1938326.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,16 @@ def test_migrate_from_forced_down_host(self):
7272
source_compute_id = self.api.get_services(
7373
host='src', binary='nova-compute')[0]['id']
7474
self.api.put_service(source_compute_id, {'forced_down': 'true'})
75+
# NOTE(gibi): extra retries are needed as the default 10 retries with
76+
# 0.5 second sleep is close to the 6 seconds down timeout
7577
self._wait_for_service_parameter(
7678
'src', 'nova-compute',
7779
{
7880
'forced_down': True,
7981
'state': 'down',
8082
'status': 'enabled'
81-
}
83+
},
84+
max_retries=20,
8285
)
8386

8487
# Assert that we cannot migrate from a forced down compute
@@ -94,12 +97,15 @@ def test_migrate_from_down_host(self):
9497

9598
# Stop the compute service and wait until it's down
9699
self.computes['src'].stop()
100+
# NOTE(gibi): extra retries are needed as the default 10 retries with
101+
# 0.5 second sleep is close to the 6 seconds down timeout
97102
self._wait_for_service_parameter(
98103
'src', 'nova-compute',
99104
{
100105
'state': 'down',
101106
'status': 'enabled'
102-
}
107+
},
108+
max_retries=20,
103109
)
104110

105111
# Assert that requests to migrate from down computes are rejected
@@ -123,8 +129,10 @@ def test_migrate_from_disabled_down_host(self):
123129

124130
# Stop the compute service and wait until it's down
125131
self.computes['src'].stop()
132+
# NOTE(gibi): extra retries are needed as the default 10 retries with
133+
# 0.5 second sleep is close to the 6 seconds down timeout
126134
self._wait_for_service_parameter(
127-
'src', 'nova-compute', {'state': 'down'})
135+
'src', 'nova-compute', {'state': 'down'}, max_retries=20)
128136

129137
ex = self.assertRaises(
130138
client.OpenStackApiException, self.api.post_server_action,

0 commit comments

Comments
 (0)