mirror of
https://github.com/ansible/awx.git
synced 2026-03-24 20:35:02 -02:30
adjust the default capacity_adjustment to 0.75
This commit is contained in:
@@ -160,7 +160,7 @@ class Instance(HasPolicyEditsMixin, BaseModel):
|
|||||||
default=100,
|
default=100,
|
||||||
editable=False,
|
editable=False,
|
||||||
)
|
)
|
||||||
capacity_adjustment = models.DecimalField(default=Decimal(1.0), max_digits=3, decimal_places=2, validators=[MinValueValidator(Decimal(0.0))])
|
capacity_adjustment = models.DecimalField(default=Decimal(0.75), max_digits=3, decimal_places=2, validators=[MinValueValidator(Decimal(0.0))])
|
||||||
enabled = models.BooleanField(default=True)
|
enabled = models.BooleanField(default=True)
|
||||||
managed_by_policy = models.BooleanField(default=True)
|
managed_by_policy = models.BooleanField(default=True)
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ def test_dispatcher_max_workers_reserve(settings, fake_redis):
|
|||||||
plus reserve worker count
|
plus reserve worker count
|
||||||
"""
|
"""
|
||||||
with override_settings(**settings):
|
with override_settings(**settings):
|
||||||
i = Instance.objects.create(hostname='test-1', node_type='hybrid')
|
i = Instance.objects.create(hostname='test-1', node_type='hybrid', capacity_adjustment=1.0)
|
||||||
i.local_health_check()
|
i.local_health_check()
|
||||||
|
|
||||||
assert get_auto_max_workers() == i.capacity + 7, (i.cpu, i.memory, i.cpu_capacity, i.mem_capacity)
|
assert get_auto_max_workers() == i.capacity + 7, (i.cpu, i.memory, i.cpu_capacity, i.mem_capacity)
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ def test_job_capacity_and_with_inactive_node():
|
|||||||
i = Instance.objects.create(hostname='test-1')
|
i = Instance.objects.create(hostname='test-1')
|
||||||
i.save_health_data('18.0.1', 2, 8000)
|
i.save_health_data('18.0.1', 2, 8000)
|
||||||
assert i.enabled is True
|
assert i.enabled is True
|
||||||
assert i.capacity_adjustment == 1.0
|
assert i.capacity_adjustment == 0.75
|
||||||
assert i.capacity == 62
|
assert i.capacity == 48.5
|
||||||
i.enabled = False
|
i.enabled = False
|
||||||
i.save()
|
i.save()
|
||||||
with override_settings(CLUSTER_HOST_ID=i.hostname):
|
with override_settings(CLUSTER_HOST_ID=i.hostname):
|
||||||
|
|||||||
Reference in New Issue
Block a user