Fix floating ip timeout issues with uwsgi enabled
This reverts commit d4c9cc89f199899b20cfaea975ecd15ee66d3523 which
introduced a waiter to fix a bug in Tempest. Unfortunately that broke
neutron-tempest-with-uwsgi job where some of the tests started to fail
due to timeouts - waiting for the floating ip to get attached to a server
prolonged the tests which caused the timeout (it seems the ip attachment
process takes longer on an environment with uwsgi).
The failing tests also didn't require an attached floating ip or they
did however long enough after the server creation thus it is redundant
to wait for the ip attachment at the beginning (when the resource is
created) when it can happen "in parallel".
This patch moves the waiter from the common file to the test class
where the waiter is needed to fix a bug [1].
[1] https://bugs.launchpad.net/tempest/+bug/1945495
Closes-Bug: #1960022
Change-Id: Iddfa4ef874328fdee5418de5a8b1112007541883
diff --git a/tempest/api/compute/servers/test_server_actions.py b/tempest/api/compute/servers/test_server_actions.py
index 152e7e8..c415c00 100644
--- a/tempest/api/compute/servers/test_server_actions.py
+++ b/tempest/api/compute/servers/test_server_actions.py
@@ -43,6 +43,17 @@
super(ServerActionsTestJSON, self).setUp()
# Check if the server is in a clean state after test
try:
+ validation_resources = self.get_class_validation_resources(
+ self.os_primary)
+ # _test_rebuild_server test compares ip address attached to the
+ # server before and after the rebuild, in order to avoid
+ # a situation when a newly created server doesn't have a floating
+ # ip attached at the beginning of the test_rebuild_server let's
+ # make sure right here the floating ip is attached
+ waiters.wait_for_server_floating_ip(
+ self.client,
+ self.client.show_server(self.server_id)['server'],
+ validation_resources['floating_ip'])
waiters.wait_for_server_status(self.client,
self.server_id, 'ACTIVE')
except lib_exc.NotFound:
diff --git a/tempest/common/compute.py b/tempest/common/compute.py
index 16322df..2443a67 100644
--- a/tempest/common/compute.py
+++ b/tempest/common/compute.py
@@ -230,9 +230,6 @@
fip_client.associate_floating_ip_to_server(
floating_ip=validation_resources['floating_ip']['ip'],
server_id=servers[0]['id'])
- waiters.wait_for_server_floating_ip(
- clients.servers_client,
- servers[0], validation_resources['floating_ip'])
if wait_until:
for server in servers: