yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #59692
[Bug 1639894] Re: TestInstanceNotificationSample.test_volume_swap_server_with_error is racy
Reviewed: https://review.openstack.org/394585
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2e32ed122b415009722456716c47d8374e9d449c
Submitter: Jenkins
Branch: master
commit 2e32ed122b415009722456716c47d8374e9d449c
Author: Matt Riedemann <mriedem@xxxxxxxxxx>
Date: Wed Nov 23 16:18:18 2016 -0500
Fix race in test_volume_swap_server_with_error
This functional test is waiting for a flag to be set in
the CinderFixture which is called when swap_volume calls
volume_api.unreserve_volume after the swap_volume error
occurs. That happens after the two swap-volume notifications
are sent (for start and error).
The test was asserting a 5th notification for the generic
instance fault, which happens, but might not happen before
the CinderFixture flag is set and the test checks for 5
notifications.
This test really only cares that there are the two swap-volume
notifications, so to avoid a race this change just makes
the test assert that there are at least 4 versioned notifications
by the time the swap-volume error occurs, which is all it was
checking after that anyway.
Change-Id: I8fd44b083f109c034958a305a4e41f9d810c4389
Closes-Bug: #1639894
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1639894
Title:
TestInstanceNotificationSample.test_volume_swap_server_with_error is
racy
Status in OpenStack Compute (nova):
Fix Released
Bug description:
This failed on an unrelated change today:
http://logs.openstack.org/24/394524/1/check/gate-nova-tox-db-
functional-ubuntu-
xenial/01a5cce/console.html#_2016-11-07_17_27_14_569696
https://github.com/openstack/nova/blob/0132cc8c2663843a891e054d9185e6ba2fd589ad/nova/tests/functional/notification_sample_tests/test_instance.py#L547
That says it expects 3 notifications, but it really only cares about
2. Based on when the compute.exception happens, and when
self._wait_until_swap_volume_error() returns True, the 3rd
compute.exception notification might not have happened.
The swap_error flag is set in the cinder fixture here:
https://github.com/openstack/nova/blob/0132cc8c2663843a891e054d9185e6ba2fd589ad/nova/tests/fixtures.py#L868
That happens here:
https://github.com/openstack/nova/blob/0132cc8c2663843a891e054d9185e6ba2fd589ad/nova/compute/manager.py#L4936
Which is after the swap-volume error notification is sent.
The compute.exception comes from the instance fault handler here:
https://github.com/openstack/nova/blob/0132cc8c2663843a891e054d9185e6ba2fd589ad/nova/compute/manager.py#L4961
Which is after cinder.swap_error is set to true.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1639894/+subscriptions
References