lujiajing1126 commented on code in PR #324:
URL:
https://github.com/apache/skywalking-banyandb/pull/324#discussion_r1328897646
##########
test/integration/distributed/setup/node_test.go:
##########
@@ -86,4 +92,64 @@ var _ = Describe("Node registration", func() {
return helpers.ListKeys(etcdEndpoint,
fmt.Sprintf("/%s/nodes/%s:%d", namespace, nodeHost, ports[0]))
}, flags.EventuallyTimeout).Should(BeNil())
})
+
+ It("should register multiple data nodes in the node selector
successfully", func() {
+ namespace := "data-test"
+ nodeDataHosts := []string{"data-node-1", "data-node-2"}
+ nodeDataIDs := make([]string, len(nodeDataHosts))
+ ports, err := test.AllocateFreePorts(2)
+ Expect(err).NotTo(HaveOccurred())
+
+ var closeFns []func()
+ for i, nodeDataHost := range nodeDataHosts {
+ addr := fmt.Sprintf("%s:%d", host, ports[i])
+ closeFns = append(closeFns, setup.CMD("data",
+ "--namespace", namespace,
+ "--grpc-host="+host,
+ fmt.Sprintf("--grpc-port=%d", ports[i]),
+ "--etcd-endpoints", etcdEndpoint,
+ "--node-host-provider", "flag",
+ "--node-host", nodeDataHost))
+ nodeDataIDs[i] = fmt.Sprintf("%s:%d", nodeDataHost,
ports[i])
+ Eventually(
+ helpers.HealthCheck(addr, 10*time.Second,
10*time.Second, grpc.WithTransportCredentials(insecure.NewCredentials())),
+ flags.EventuallyTimeout).Should(Succeed())
+ Eventually(func() (map[string]*databasev1.Node, error) {
+ return helpers.ListKeys(etcdEndpoint,
fmt.Sprintf("/%s/nodes/%s:%d", namespace, nodeDataHost, ports[i]))
+ }, flags.EventuallyTimeout).Should(HaveLen(1))
+ }
+
+ // TODO: refactor the following startup logic
Review Comment:
Any idea how we can better organize such (fine-grained) services setup
##########
test/integration/distributed/setup/node_test.go:
##########
@@ -86,4 +92,64 @@ var _ = Describe("Node registration", func() {
return helpers.ListKeys(etcdEndpoint,
fmt.Sprintf("/%s/nodes/%s:%d", namespace, nodeHost, ports[0]))
}, flags.EventuallyTimeout).Should(BeNil())
})
+
+ It("should register multiple data nodes in the node selector
successfully", func() {
+ namespace := "data-test"
+ nodeDataHosts := []string{"data-node-1", "data-node-2"}
+ nodeDataIDs := make([]string, len(nodeDataHosts))
+ ports, err := test.AllocateFreePorts(2)
+ Expect(err).NotTo(HaveOccurred())
+
+ var closeFns []func()
+ for i, nodeDataHost := range nodeDataHosts {
+ addr := fmt.Sprintf("%s:%d", host, ports[i])
+ closeFns = append(closeFns, setup.CMD("data",
+ "--namespace", namespace,
+ "--grpc-host="+host,
+ fmt.Sprintf("--grpc-port=%d", ports[i]),
+ "--etcd-endpoints", etcdEndpoint,
+ "--node-host-provider", "flag",
+ "--node-host", nodeDataHost))
+ nodeDataIDs[i] = fmt.Sprintf("%s:%d", nodeDataHost,
ports[i])
+ Eventually(
+ helpers.HealthCheck(addr, 10*time.Second,
10*time.Second, grpc.WithTransportCredentials(insecure.NewCredentials())),
+ flags.EventuallyTimeout).Should(Succeed())
+ Eventually(func() (map[string]*databasev1.Node, error) {
+ return helpers.ListKeys(etcdEndpoint,
fmt.Sprintf("/%s/nodes/%s:%d", namespace, nodeDataHost, ports[i]))
+ }, flags.EventuallyTimeout).Should(HaveLen(1))
+ }
+
+ // TODO: refactor the following startup logic
Review Comment:
Any idea how we can better organize such (fine-grained) services setup
@hanahmily
--
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]