(t *testing.T, duration time.Duration, c *HATracker, user string, expectedReplicaGroups int)
| 1061 | } |
| 1062 | |
| 1063 | func 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 | |
| 1078 | func checkReplicaDeletionState(t *testing.T, duration time.Duration, c *HATracker, user, replicaGroup string, expectedExistsInMemory, expectedExistsInKV, expectedMarkedForDeletion bool) { |
| 1079 | key := fmt.Sprintf("%s/%s", user, replicaGroup) |
no test coverage detected