stabilize test_resize_server_error_and_reschedule_was_failed

The Ia5311ffc12784987c138b127e43cfc52019cb3ea patch tried to fix a fluctuation
in the test_resize_server_error_and_reschedule_was_failed functional test.
But the test still fluctuates even after that patch is merged[1]. Looking back
to the origin patch the problem is obvious and embarrassing. The extra
_wait_for_notification call was introduced _after_ the assert that checks
the number of received notifications. So the original patch never worked.

This patch moves the extra wait call _before_ the assert.

[1] http://logs.openstack.org/55/483955/9/check/gate-nova-tox-functional-ubuntu-xenial/209d046/console.html#_2017-10-04_21_52_53_807624

Change-Id: I4c104842cbde587dc9c67f5fde84140252cdcdb5
Closes-Bug: #1717917
This commit is contained in:
Balazs Gibizer 2017-10-05 11:56:56 +02:00
parent a6eadd8e30
commit 265ed23bb2
1 changed files with 1 additions and 1 deletions

View File

@ -730,13 +730,13 @@ class TestInstanceNotificationSample(
mock_reschedule.side_effect = _build_resources
self.api.post_server_action(server['id'], post)
self._wait_for_state_change(self.api, server, expected_status='ERROR')
self._wait_for_notification('compute.exception')
# There should be two notifications, one for the instance.resize.error
# and one for the compute.exception via the wrap_exception decorator on
# the ComputeManager.prep_resize method.
self.assertEqual(2, len(fake_notifier.VERSIONED_NOTIFICATIONS),
'Unexpected number of notifications: %s' %
fake_notifier.VERSIONED_NOTIFICATIONS)
self._wait_for_notification('compute.exception')
self._verify_notification('instance-resize-error',
replacements={
'reservation_id': server['reservation_id'],