From 4ab078d6754147ce731523292dd1882f8a7b5775 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bastian=20K=C3=B6cher?= <git@kchr.de>
Date: Wed, 29 May 2024 23:23:27 +0200
Subject: [PATCH] pallet-staking: Put tests behind `cfg(debug_assertions)`
 (#4620)

Otherwise these tests are failing if you don't run with
`debug_assertions` enabled, which happens if you run tests locally in
release mode.
---
 substrate/frame/staking/src/tests.rs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/substrate/frame/staking/src/tests.rs b/substrate/frame/staking/src/tests.rs
index 76afa3333cb..2229eb28329 100644
--- a/substrate/frame/staking/src/tests.rs
+++ b/substrate/frame/staking/src/tests.rs
@@ -5251,6 +5251,7 @@ mod election_data_provider {
 	// maybe_max_len`.
 	#[test]
 	#[should_panic]
+	#[cfg(debug_assertions)]
 	fn only_iterates_max_2_times_max_allowed_len() {
 		ExtBuilder::default()
 			.nominate(false)
@@ -5939,6 +5940,7 @@ fn min_commission_works() {
 
 #[test]
 #[should_panic]
+#[cfg(debug_assertions)]
 fn change_of_absolute_max_nominations() {
 	use frame_election_provider_support::ElectionDataProvider;
 	ExtBuilder::default()
-- 
GitLab