From b33ec96bd12722264f49daad7e641fc971b66eb8 Mon Sep 17 00:00:00 2001 From: Julien Duchesne Date: Fri, 10 Jan 2025 09:58:53 -0500 Subject: [PATCH] Add test to check that group isn't mutated --- pkg/ruler/rule_concurrency_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/ruler/rule_concurrency_test.go b/pkg/ruler/rule_concurrency_test.go index 9d18982ef4..e7c485db30 100644 --- a/pkg/ruler/rule_concurrency_test.go +++ b/pkg/ruler/rule_concurrency_test.go @@ -244,6 +244,10 @@ func TestSplitGroupIntoBatches(t *testing.T) { batches := controller.SplitGroupIntoBatches(context.Background(), group) requireConcurrentRulesEqual(t, tc.expectedGroups, batches) + + // Make sure the group is not mutated and will still return the same batches when called again. + batches = controller.SplitGroupIntoBatches(context.Background(), group) + requireConcurrentRulesEqual(t, tc.expectedGroups, batches) }) } }