Fix floating ip timeout issues with uwsgi enabled

This reverts commit d4c9cc89f1 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
This commit is contained in:
Martin Kopec 2022-02-08 17:18:02 +00:00
parent d4c9cc89f1
commit 78b960f91f
2 changed files with 11 additions and 3 deletions

View File

@ -43,6 +43,17 @@ class ServerActionsTestJSON(base.BaseV2ComputeTest):
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:

View File

@ -230,9 +230,6 @@ def create_test_server(clients, validatable=False, validation_resources=None,
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: