commit 4fe4fbe7a43ac7e971b0aabc8a9079c7701cae55
Author: Matt Riedemann <email address hidden>
Date: Wed Aug 29 11:58:12 2018 -0400
Restart scheduler in TestNovaManagePlacementHealAllocations
TestNovaManagePlacementHealAllocations tests rely on the
CachingScheduler specifically because it does not use
placement and therefore does not create allocations during
scheduling, which gives us instances that need to heal
allocations.
However, we have a race in the test setup where the scheduler
is started before the compute services. The CachingScheduler
runs a periodic task on startup to fetch the hosts from the
DB to initialize it's cache, and then uses that during scheduling
until the periodic runs again. So what we can hit is the
scheduler starts, loads an empty cache, then we start the computes
and try to create an instance but because of the empty cache we
fail with a NoValidHost error.
This restarts and resets the CachingScheduler cache *after* we have
started the computes and asserted they are available in the API.
Reviewed: https:/ /review. openstack. org/597571 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=4fe4fbe7a43 ac7e971b0aabc8a 9079c7701cae55
Committed: https:/
Submitter: Zuul
Branch: master
commit 4fe4fbe7a43ac7e 971b0aabc8a9079 c7701cae55
Author: Matt Riedemann <email address hidden>
Date: Wed Aug 29 11:58:12 2018 -0400
Restart scheduler in TestNovaManageP lacementHealAll ocations
TestNovaMan agePlacementHea lAllocations tests rely on the duler specifically because it does not use
CachingSche
placement and therefore does not create allocations during
scheduling, which gives us instances that need to heal
allocations.
However, we have a race in the test setup where the scheduler
is started before the compute services. The CachingScheduler
runs a periodic task on startup to fetch the hosts from the
DB to initialize it's cache, and then uses that during scheduling
until the periodic runs again. So what we can hit is the
scheduler starts, loads an empty cache, then we start the computes
and try to create an instance but because of the empty cache we
fail with a NoValidHost error.
This restarts and resets the CachingScheduler cache *after* we have
started the computes and asserted they are available in the API.
Change-Id: I32f607a436e985 1a96877123ae3d1 fe51f444f73
Closes-Bug: #1781648