From: Daniel Kral <d.kral@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH perl-rs v4 2/2] test: resource_scheduling: use score_nodes helper to imitate HA Manager
Date: Fri, 14 Nov 2025 11:06:16 +0100 [thread overview]
Message-ID: <20251114100641.92919-5-d.kral@proxmox.com> (raw)
In-Reply-To: <20251114100641.92919-1-d.kral@proxmox.com>
Signed-off-by: Daniel Kral <d.kral@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
---
no changes
pve-rs/test/resource_scheduling.pl | 24 +++---------------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/pve-rs/test/resource_scheduling.pl b/pve-rs/test/resource_scheduling.pl
index 42556bd..a332269 100755
--- a/pve-rs/test/resource_scheduling.pl
+++ b/pve-rs/test/resource_scheduling.pl
@@ -48,13 +48,7 @@ sub test_balance {
};
for (my $i = 0; $i < 15; $i++) {
- my $score_list = $static->score_nodes_to_start_service($service);
-
- # imitate HA manager
- my $scores = { map { $_->[0] => -$_->[1] } $score_list->@* };
- my @nodes = sort {
- $scores->{$a} <=> $scores->{$b} || $a cmp $b
- } keys $scores->%*;
+ my @nodes = score_nodes($static, $service);
if ($i % 3 == 2) {
is($nodes[0], "A", 'first should be A');
@@ -133,13 +127,7 @@ sub test_overcommitted {
$static->add_service_usage_to_node("B", "d", $service);
$static->add_service_usage_to_node("A", "e", $service);
- my $score_list = $static->score_nodes_to_start_service($service);
-
- # imitate HA manager
- my $scores = { map { $_->[0] => -$_->[1] } $score_list->@* };
- my @nodes = sort {
- $scores->{$a} <=> $scores->{$b} || $a cmp $b
- } keys $scores->%*;
+ my @nodes = score_nodes($static, $service);
is($nodes[0], "C", 'first should be C');
is($nodes[1], "D", 'second should be D');
@@ -168,13 +156,7 @@ sub test_balance_small_memory_difference {
};
for (my $i = 0; $i < 20; $i++) {
- my $score_list = $static->score_nodes_to_start_service($service);
-
- # imitate HA manager
- my $scores = { map { $_->[0] => -$_->[1] } $score_list->@* };
- my @nodes = sort {
- $scores->{$a} <=> $scores->{$b} || $a cmp $b
- } keys $scores->%*;
+ my @nodes = score_nodes($static, $service);
if ($i % 4 <= 1) {
is($nodes[0], "A", 'first should be A');
--
2.47.3
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-11-14 10:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 10:06 [pve-devel] [PATCH-SERIES ha-manager/perl-rs/proxmox v4 00/12] Granular online_node_usage accounting Daniel Kral
2025-11-14 10:06 ` [pve-devel] [PATCH proxmox v4 1/2] resource-scheduling: use workspace's .cargo/config.toml Daniel Kral
2025-11-14 10:06 ` [pve-devel] [PATCH proxmox v4 2/2] resource-scheduling: allow owned nodes slice for score_nodes_to_start_service Daniel Kral
2025-11-14 10:06 ` [pve-devel] [PATCH perl-rs v4 1/2] pve-rs: resource scheduling: allow granular usage changes Daniel Kral
2025-11-14 10:06 ` Daniel Kral [this message]
2025-11-14 10:06 ` [pve-devel] [PATCH ha-manager v4 1/8] manager: remove redundant recompute_online_node_usage from next_state_recovery Daniel Kral
2025-11-14 10:06 ` [pve-devel] [PATCH ha-manager v4 2/8] manager: remove redundant add_service_usage_to_node " Daniel Kral
2025-11-14 10:06 ` [pve-devel] [PATCH ha-manager v4 3/8] manager: remove redundant add_service_usage_to_node from next_state_started Daniel Kral
2025-11-14 10:06 ` [pve-devel] [PATCH ha-manager v4 4/8] rules: resource affinity: decouple get_resource_affinity helper from Usage class Daniel Kral
2025-11-14 10:06 ` [pve-devel] [PATCH ha-manager v4 5/8] manager: make recompute_online_node_usage use add_service_usage helper Daniel Kral
2025-11-14 10:06 ` [pve-devel] [PATCH ha-manager v4 6/8] usage: allow granular changes to Usage implementations Daniel Kral
2025-11-14 10:06 ` [pve-devel] [PATCH ha-manager v4 7/8] manager: make online node usage computation granular Daniel Kral
2025-11-14 10:06 ` [pve-devel] [PATCH ha-manager v4 8/8] implement static service stats cache Daniel Kral
2025-11-14 12:57 ` [pve-devel] applied-series: [PATCH-SERIES ha-manager/perl-rs/proxmox v4 00/12] Granular online_node_usage accounting Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251114100641.92919-5-d.kral@proxmox.com \
--to=d.kral@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox