The notification sample test for unshelve waits for the instance to
reach ACTIVE state and then asserts if unshelve.end notification is
emitted properly. However the instance.vm_state is set to ACTIVE earlier[1]
than emitting the unshelve.end notification[2]. This can cause two
different test case failure.
1) _test_unshelve_server() fails with no ushelve.end notification
received.
2) _test_shelve_and_shelve_offload_server() also has a unshelve action
at the end and that test step also only waits for the the ACTIVE state.
So the unshelve.end notification from the end of
_test_shelve_and_shelve_offload_server() can bleed into the
_test_unshelve_server() step causing that it receive one more
notifications.
So this patch adds an extra
self._wait_for_notification('instance.unshelve.end') call to each test
step to prevent the instability.
Reviewed: https:/ /review. opendev. org/674636 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=8afc39a2c74 8a8fde070493dd5 633788f782c69a
Committed: https:/
Submitter: Zuul
Branch: stable/queens
commit 8afc39a2c748a8f de070493dd56337 88f782c69a
Author: Balazs Gibizer <email address hidden>
Date: Tue Jul 2 14:56:40 2019 +0200
Stabilize unshelve notification sample tests
The notification sample test for unshelve waits for the instance to
reach ACTIVE state and then asserts if unshelve.end notification is
emitted properly. However the instance.vm_state is set to ACTIVE earlier[1]
than emitting the unshelve.end notification[2]. This can cause two
different test case failure.
1) _test_unshelve_ server( ) fails with no ushelve.end notification
received.
2) _test_shelve_ and_shelve_ offload_ server( ) also has a unshelve action shelve_ and_shelve_ offload_ server( ) can bleed into the unshelve_ server( ) step causing that it receive one more
at the end and that test step also only waits for the the ACTIVE state.
So the unshelve.end notification from the end of
_test_
_test_
notifications.
So this patch adds an extra _wait_for_ notification( 'instance. unshelve. end') call to each test
self.
step to prevent the instability.
[1] https:/ /github. com/openstack/ nova/blob/ 5c6c1f8f/ nova/compute/ manager. py#L5322- L5326 /github. com/openstack/ nova/blob/ 5c6c1f8f/ nova/compute/ manager. py#L5329 /github. com/openstack/ nova/blob/ 5c6c1f8f/ nova/tests/ functional/ notification_ sample_ tests/test_ instance. py#L836
[2] https:/
[3] https:/
Conflicts:
nova/ tests/functiona l/notification_ sample_ tests/test_ instance. py 29db77c18b932e3 16196880de5
Conflicts due to:
* I1a0afa0e8740c2
Closes-Bug: #1835070
Change-Id: Ie217523a896932 6b27930d7f74e50 e9b352ab7a1 23614b34f28bb7f c416b668a8) 3844db363010988 d8d08cff00) 672e4fa2d7912f6 880079c6ef)
(cherry picked from commit 40f1e7c4c22dc60
(cherry picked from commit 3bc6ff029ff2408
(cherry picked from commit a85ce04fa39e60e