mrproliu commented on code in PR #1007:
URL: 
https://github.com/apache/skywalking-banyandb/pull/1007#discussion_r2922876954


##########
test/integration/distributed/lifecycle/property/suite_test.go:
##########
@@ -102,19 +100,34 @@ func init() {
        }
 }
 
-func diffGroups(left, right []string) []string {
-       rightSet := make(map[string]struct{}, len(right))
-       for _, groupName := range right {
-               rightSet[groupName] = struct{}{}
-       }
-       result := make([]string, 0)
-       for _, groupName := range left {
-               if _, exists := rightSet[groupName]; exists {
-                       continue
+func verifyClusterNodeRoles(liaisonAddr string) {
+       conn, connErr := grpchelper.Conn(liaisonAddr, 10*time.Second,
+               grpclib.WithTransportCredentials(insecure.NewCredentials()))
+       Expect(connErr).NotTo(HaveOccurred())
+       defer func() { _ = conn.Close() }()
+       clusterClient := databasev1.NewClusterStateServiceClient(conn)
+       state, stateErr := clusterClient.GetClusterState(
+               context.Background(), &databasev1.GetClusterStateRequest{})
+       Expect(stateErr).NotTo(HaveOccurred())
+       tire2 := state.GetRouteTables()["tire2"]
+       Expect(tire2).NotTo(BeNil(), "tire2 route table not found")
+       for _, node := range tire2.GetRegistered() {
+               labels := node.GetLabels()
+               hasMetaRole := false
+               for _, role := range node.GetRoles() {
+                       if role == databasev1.Role_ROLE_META {
+                               hasMetaRole = true
+                               break
+                       }
+               }
+               if labels["type"] == "hot" {
+                       Expect(hasMetaRole).To(BeTrue(),
+                               fmt.Sprintf("hot node %s should have 
ROLE_META", node.GetMetadata().GetName()))
+               } else if labels["type"] == "warm" {
+                       Expect(hasMetaRole).To(BeFalse(),
+                               fmt.Sprintf("warm node %s should NOT have 
ROLE_META", node.GetMetadata().GetName()))
                }

Review Comment:
   Added the node count check. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to