Replace time.sleep(10) with service forced_down in tests
The server group functional tests are doing time.sleep(10) in order
to make sure a stopped compute service is considered "down" by the nova
compute API.
Instead of sleeping, we can set the service as "forced_down" to get the
desired "down" compute service status and avoid unnecessary delays in
these tests.
Unnecessary service start() calls are also removed in this change. They
appear at the end of tests and services are started during each test
setUp() and killed during each test tearDown() via the ServiceFixture.
Closes-Bug: #1783565
NOTE(melwitt): The differences from the cherry picked change are:
* Addition of 'from nova import utils' because change Ie07b419732e0832a9b9d16565f6c9d00ba85d654 is not in Rocky
* Addition of the put_service_force_down method for the API client
because change If0693eab2ed31b5fbfe6cbafa5d67b69c2ed8442 is not
in Rocky
Change-Id: I74f64b68e4b33ee0f8c45fdc5f570c7e12e05d3b
(cherry picked from commit 1c93ca82b8fb8e39787020decfe335d45f8732e7)
(cherry picked from commit a5daa0ddb3129ddd1bea4e85570c047fc2912b1a)
(cherry picked from commit 92eb45ba5eb413400e1789f09d3739ee8c0b77de)
Reviewed: https:/ /review. opendev. org/696217 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=ffce5be5cae 59969ec5ecf7e2b 36ae4ec87c29d1
Committed: https:/
Submitter: Zuul
Branch: stable/rocky
commit ffce5be5cae5996 9ec5ecf7e2b36ae 4ec87c29d1
Author: melanie witt <email address hidden>
Date: Thu Oct 31 01:57:41 2019 +0000
Replace time.sleep(10) with service forced_down in tests
The server group functional tests are doing time.sleep(10) in order
to make sure a stopped compute service is considered "down" by the nova
compute API.
Instead of sleeping, we can set the service as "forced_down" to get the
desired "down" compute service status and avoid unnecessary delays in
these tests.
Unnecessary service start() calls are also removed in this change. They
appear at the end of tests and services are started during each test
setUp() and killed during each test tearDown() via the ServiceFixture.
Closes-Bug: #1783565
NOTE(melwitt): The differences from the cherry picked change are:
* Addition of 'from nova import utils' because change
Ie07b419732e08 32a9b9d16565f6c 9d00ba85d654 is not in Rocky
* Addition of the put_service_ force_down method for the API client 5fbfe6cbafa5d67 b69c2ed8442 is not
because change If0693eab2ed31b
in Rocky
Change-Id: I74f64b68e4b33e e0f8c45fdc5f570 c7e12e05d3b 9787020decfe335 d45f8732e7) d1bea4e85570c04 7fc2912b1a) 00e1789f09d3739 ee8c0b77de)
(cherry picked from commit 1c93ca82b8fb8e3
(cherry picked from commit a5daa0ddb3129dd
(cherry picked from commit 92eb45ba5eb4134