MCPcopy Create free account
hub / github.com/cortexproject/cortex / checkUserReplicaGroups

Function checkUserReplicaGroups

pkg/ha/ha_tracker_test.go:1063–1076  ·  view source on GitHub ↗
(t *testing.T, duration time.Duration, c *HATracker, user string, expectedReplicaGroups int)

Source from the content-addressed store, hash-verified

1061}
1062
1063func checkUserReplicaGroups(t *testing.T, duration time.Duration, c *HATracker, user string, expectedReplicaGroups int) {
1064 t.Helper()
1065 test.Poll(t, duration, nil, func() any {
1066 c.electedLock.RLock()
1067 cl := len(c.replicaGroups[user])
1068 c.electedLock.RUnlock()
1069
1070 if cl != expectedReplicaGroups {
1071 return fmt.Errorf("expected clusters: %d, got %d", expectedReplicaGroups, cl)
1072 }
1073
1074 return nil
1075 })
1076}
1077
1078func checkReplicaDeletionState(t *testing.T, duration time.Duration, c *HATracker, user, replicaGroup string, expectedExistsInMemory, expectedExistsInKV, expectedMarkedForDeletion bool) {
1079 key := fmt.Sprintf("%s/%s", user, replicaGroup)

Callers 1

TestCheckReplicaCleanupFunction · 0.85

Calls 1

PollFunction · 0.92

Tested by

no test coverage detected