nova/nova/tests/unit/scheduler
Dan Smith 5d86aa7edb Fix interpretation of max_attempts for scheduling alternates
Since max_attempts is not max_retries, we should look for max_attempts-1
alternate hosts. This change makes the num_alts variable actually reflect
the number of alternates we are looking for, and doesn't actually change
the logic at all. This also adds functional tests to verify max_attempts
behavior with 1 (no retries) and 2 (one retry), just to make sure it is
doing what we expect.

Further, we optimize _get_alternate_hosts() to only re-filter/weigh the
host list if we're looking for alternates for multiple instances. Now
that it's clear that num_alts is only nonzero if we are going to look
at the host list again to find those alternates, it can be more clearly
(and accurately) used to optimize out that extra step if we are not
getting alternates.

Change-Id: I16ba29385dd2db5467829e6c17fc395096b5cfd3
2018-05-18 09:06:07 -07:00
..
client Add random sleep between retry calls to placement 2018-05-10 11:20:01 +03:00
filters Remove ExactCoreFilter ExactDiskFilter ExactRamFilter 2018-05-01 10:33:23 -04:00
weights Add CPUWeigher 2018-04-18 15:20:30 +01:00
__init__.py move all tests to nova/tests/unit 2014-11-12 15:31:08 -05:00
fakes.py Don't filter out sibling sets with one core 2018-01-30 10:09:59 +00:00
ironic_fakes.py Set IronicNodeState.uuid in _update_from_compute_node 2017-07-25 17:52:47 -04:00
test_caching_scheduler.py Modify select_destinations() to return objects and alts 2017-12-07 15:01:13 +00:00
test_chance_scheduler.py Modify select_destinations() to return objects and alts 2017-12-07 15:01:13 +00:00
test_client.py [placement] Add sending global request ID in delete (3) 2018-01-22 02:23:12 +00:00
test_filter_scheduler.py Fix interpretation of max_attempts for scheduling alternates 2018-05-18 09:06:07 -07:00
test_filters.py Fix invalid uuid warnings 2016-05-10 09:04:37 +00:00
test_host_filters.py Modify left filters for RequestSpec 2015-12-11 12:27:20 +01:00
test_host_manager.py Make host_manager use scatter-gather and ignore down cells 2018-04-27 12:14:27 -07:00
test_request_filter.py Add require_tenant_aggregate request filter 2018-03-28 15:58:46 -07:00
test_rpcapi.py remove unnecessary conf imports 2018-03-09 14:30:10 -05:00
test_scheduler.py Remove [scheduler]/host_manager config option 2018-05-03 09:39:26 -04:00
test_scheduler_utils.py Fix invalid UUIDs in remaining tests 2018-01-30 17:15:03 +00:00
test_utils.py update scheduler to use image-traits 2018-05-10 13:58:42 -07:00