mirror of
https://git.proxmox.com/git/proxmox-perl-rs
synced 2025-06-27 15:03:44 +00:00
pve: test: resource scheduling: add another test where memory is secondary to CPU
but this time, without any start load on the node. This test fails with librust-proxmox-resource-scheduling-dev=0.2.0-1 Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
14a3de9826
commit
bfc7f2c518
@ -86,16 +86,20 @@ sub test_overcommitted {
|
|||||||
is($nodes[3], "A", 'fourth should be A');
|
is($nodes[3], "A", 'fourth should be A');
|
||||||
}
|
}
|
||||||
|
|
||||||
sub test_balance_small_memory_difference_with_start_load {
|
sub test_balance_small_memory_difference {
|
||||||
|
my ($with_start_load) = @_;
|
||||||
|
|
||||||
my $static = PVE::RS::ResourceScheduling::Static->new();
|
my $static = PVE::RS::ResourceScheduling::Static->new();
|
||||||
# Memory is different to avoid flaky results with what would otherwise be ties.
|
# Memory is different to avoid flaky results with what would otherwise be ties.
|
||||||
$static->add_node("A", 8, 10_000_000_000);
|
$static->add_node("A", 8, 10_000_000_000);
|
||||||
$static->add_node("B", 4, 9_000_000_000);
|
$static->add_node("B", 4, 9_000_000_000);
|
||||||
$static->add_node("C", 4, 8_000_000_000);
|
$static->add_node("C", 4, 8_000_000_000);
|
||||||
|
|
||||||
$static->add_service_usage_to_node("A", { maxcpu => 4, maxmem => 1_000_000_000 });
|
if ($with_start_load) {
|
||||||
$static->add_service_usage_to_node("B", { maxcpu => 2, maxmem => 1_000_000_000 });
|
$static->add_service_usage_to_node("A", { maxcpu => 4, maxmem => 1_000_000_000 });
|
||||||
$static->add_service_usage_to_node("C", { maxcpu => 2, maxmem => 1_000_000_000 });
|
$static->add_service_usage_to_node("B", { maxcpu => 2, maxmem => 1_000_000_000 });
|
||||||
|
$static->add_service_usage_to_node("C", { maxcpu => 2, maxmem => 1_000_000_000 });
|
||||||
|
}
|
||||||
|
|
||||||
my $service = {
|
my $service = {
|
||||||
maxcpu => 3,
|
maxcpu => 3,
|
||||||
@ -134,6 +138,7 @@ sub test_balance_small_memory_difference_with_start_load {
|
|||||||
test_basic();
|
test_basic();
|
||||||
test_balance();
|
test_balance();
|
||||||
test_overcommitted();
|
test_overcommitted();
|
||||||
test_balance_small_memory_difference_with_start_load();
|
test_balance_small_memory_difference(1);
|
||||||
|
test_balance_small_memory_difference(0);
|
||||||
|
|
||||||
done_testing();
|
done_testing();
|
||||||
|
Loading…
Reference in New Issue
Block a user