From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id D641C1FF0B4 for ; Fri, 27 Nov 2026 10:46:13 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 6744A216F4; Fri, 27 Nov 2026 10:46:13 +0100 (CET) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 27 Nov 2026 10:46:09 +0100 Message-Id: Subject: Re: [PATCH proxmox-datacenter-manager 2/2] metric collection: add tests for fetching PVE clusters node by node From: "Lukas Wagner" To: "Jakob Klocker" , X-Mailer: aerc 0.22.0-0-gc2f86b7abde3 References: <20261126160707.333024-1-j.klocker@proxmox.com> <20261126160707.333024-3-j.klocker@proxmox.com> In-Reply-To: <20261126160707.333024-3-j.klocker@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1795772769127 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.184 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: V37UYWLH534WUTYSCQ7TJTEGTTKR6YR3 X-Message-ID-Hash: V37UYWLH534WUTYSCQ7TJTEGTTKR6YR3 X-MailFrom: l.wagner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Datacenter Manager development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu Nov 26, 2026 at 5:07 PM CET, Jakob Klocker wrote: > + /// Like `fake_rrd_task`, but returns the received PVE metrics. > + async fn collecting_rrd_task(mut rx: Receiver) -> V= ec { > + let mut received =3D Vec::new(); > + > + while let Some(request) =3D rx.recv().await { > + if let RrdStoreRequest::Pve { > + metrics, channel, .. > + } =3D request > + { > + let most_recent_timestamp =3D > + metrics.data.iter().map(|e| e.timestamp).max().unwra= p_or(0); > + > + received.push(metrics); > + > + let _ =3D channel.send(RrdStoreResult { > + most_recent_timestamp, > + }); > + } > + } > + > + received > + } Just wondering, since this is almost a 1:1 copy of fake_rrd_task, would it be possible to just extend fake_rrd_task and adapt the existing test cases? I did not examine it too closely, but from a gut feeling it should be possible. > + > const NOW: i64 =3D 1000; > =20 > struct TestContextFactory(); > @@ -761,4 +824,183 @@ pub(super) mod tests { > drop(task); > assert_eq!(handle.await.unwrap(), 1); > }