mirror of
https://github.com/ansible/awx.git
synced 2026-05-13 12:27:37 -02:30
set the memory value to 64 in test so that the overcall capacity is not a float value
This commit is contained in:
@@ -39,13 +39,13 @@ def test_orphan_unified_job_creation(instance, inventory):
|
|||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
@mock.patch('awx.main.tasks.system.inspect_execution_and_hop_nodes', lambda *args, **kwargs: None)
|
@mock.patch('awx.main.tasks.system.inspect_execution_and_hop_nodes', lambda *args, **kwargs: None)
|
||||||
@mock.patch('awx.main.models.ha.get_cpu_effective_capacity', lambda cpu, is_control_node: 8)
|
@mock.patch('awx.main.models.ha.get_cpu_effective_capacity', lambda cpu, is_control_node: 8)
|
||||||
@mock.patch('awx.main.models.ha.get_mem_effective_capacity', lambda mem, is_control_node: 62)
|
@mock.patch('awx.main.models.ha.get_mem_effective_capacity', lambda mem, is_control_node: 64)
|
||||||
def test_job_capacity_and_with_inactive_node():
|
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 == 0.75
|
assert i.capacity_adjustment == 0.75
|
||||||
assert i.capacity == 48.5
|
assert i.capacity == 50
|
||||||
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