From cd0ff8d3a097e9dfc4ea16e7a328abd4021622e5 Mon Sep 17 00:00:00 2001 From: Alexandru Gheorghe Date: Tue, 27 Aug 2024 17:49:51 +0300 Subject: [PATCH 1/3] Update approval-voting-regression-bench The accepted divergence rate of 1/1000 is execesive and leads to false positives especially after https://github.com/paritytech/polkadot-sdk/pull/4772 and https://github.com/paritytech/polkadot-sdk/pull/5042, so let's increase it to 1/100 since we do have some randomness in the system and there is no point in being that strict. Signed-off-by: Alexandru Gheorghe --- .../benches/approval-voting-regression-bench.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs b/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs index a18e667253d0..e08a7295913b 100644 --- a/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs +++ b/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs @@ -77,8 +77,8 @@ fn main() -> Result<(), String> { // We expect no variance for received and sent // but use 0.001 because we operate with floats messages.extend(average_usage.check_network_usage(&[ - ("Received from peers", 52941.6071, 0.001), - ("Sent to peers", 63810.1859, 0.001), + ("Received from peers", 52941.6071, 0.01), + ("Sent to peers", 63810.1859, 0.01), ])); messages.extend(average_usage.check_cpu_usage(&[ ("approval-distribution", 6.3912, 0.1), From f83fef6e4fb1c924af2ee953bf118c6007263bcb Mon Sep 17 00:00:00 2001 From: Alexandru Gheorghe Date: Wed, 28 Aug 2024 11:25:21 +0300 Subject: [PATCH 2/3] Update reference Signed-off-by: Alexandru Gheorghe --- .../benches/approval-voting-regression-bench.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs b/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs index e08a7295913b..2269a08e5f75 100644 --- a/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs +++ b/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs @@ -75,10 +75,10 @@ fn main() -> Result<(), String> { println!("{}", average_usage); // We expect no variance for received and sent - // but use 0.001 because we operate with floats + // but use 0.01 because we operate with floats messages.extend(average_usage.check_network_usage(&[ ("Received from peers", 52941.6071, 0.01), - ("Sent to peers", 63810.1859, 0.01), + ("Sent to peers", 63995.2200, 0.01), ])); messages.extend(average_usage.check_cpu_usage(&[ ("approval-distribution", 6.3912, 0.1), From ad0cd0bb4ef50a3bca8a65d21bcd76cb0cbdd1a1 Mon Sep 17 00:00:00 2001 From: Alexandru Gheorghe Date: Wed, 28 Aug 2024 11:30:16 +0300 Subject: [PATCH 3/3] Update comment Signed-off-by: Alexandru Gheorghe --- .../benches/approval-voting-regression-bench.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs b/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs index 2269a08e5f75..41418bcc511f 100644 --- a/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs +++ b/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs @@ -74,8 +74,9 @@ fn main() -> Result<(), String> { .map_err(|e| e.to_string())?; println!("{}", average_usage); - // We expect no variance for received and sent - // but use 0.01 because we operate with floats + // We expect some small variance for received and sent because the + // test messages are generated at every benchmark run and they contain + // random data so use 0.01 as the accepted variance. messages.extend(average_usage.check_network_usage(&[ ("Received from peers", 52941.6071, 0.01), ("Sent to peers", 63995.2200, 0.01),