Skip to content

Commit

Permalink
Merge pull request #1459 from zimnx/mz/enable-shard-awareness-test
Browse files Browse the repository at this point in the history
Reenable E2E test for shard-aware ports
  • Loading branch information
scylla-operator-bot[bot] authored Oct 16, 2023
2 parents 4bc44d9 + f27073c commit 84e7422
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions test/e2e/set/scyllacluster/scyllacluster_shardawareness.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
g "github.com/onsi/ginkgo/v2"
o "github.com/onsi/gomega"
"github.com/scylladb/gocqlx/v2"
scyllav1 "github.com/scylladb/scylla-operator/pkg/api/scylla/v1"
scyllaclusterfixture "github.com/scylladb/scylla-operator/test/e2e/fixture/scylla"
"github.com/scylladb/scylla-operator/test/e2e/framework"
"github.com/scylladb/scylla-operator/test/e2e/utils"
Expand All @@ -28,23 +29,29 @@ var _ = g.Describe("ScyllaCluster", func() {
f := framework.NewFramework("scyllacluster")

g.It("should allow to build connection pool using shard aware ports", func() {
g.Skip("Shardawareness doesn't work on setups NATting traffic, and our CI does it when traffic is going through ClusterIPs." +
"It's shall be reenabled once we switch client-node communication to PodIPs.",
)

const (
nonShardAwarePort = 9042
shardAwarePort = 19042
nrShards = 2
nrShards = 4
)

ctx, cancel := context.WithTimeout(context.Background(), testTimeout)
defer cancel()

sc := scyllaclusterfixture.BasicScyllaCluster.ReadOrFail()
sc.Spec.Datacenter.Racks[0].Members = 1
sc.Spec.ExposeOptions = &scyllav1.ExposeOptions{
BroadcastOptions: &scyllav1.NodeBroadcastOptions{
Clients: scyllav1.BroadcastOptions{
Type: scyllav1.BroadcastAddressTypePodIP,
},
Nodes: scyllav1.BroadcastOptions{
Type: scyllav1.BroadcastAddressTypePodIP,
},
},
}

// Ensure 2 shards.
// Ensure number of shards.
sc.Spec.Datacenter.Racks[0].Resources.Limits[corev1.ResourceCPU] = resource.MustParse(fmt.Sprintf("%d", nrShards))

framework.By("Creating a ScyllaCluster")
Expand All @@ -59,8 +66,6 @@ var _ = g.Describe("ScyllaCluster", func() {

hosts := getScyllaHostsAndWaitForFullQuorum(ctx, f.KubeClient().CoreV1(), sc)
o.Expect(hosts).To(o.HaveLen(1))
di := insertAndVerifyCQLData(ctx, hosts)
defer di.Close()

connections := make(map[uint16]string)
var connectionsMut sync.Mutex
Expand All @@ -87,7 +92,7 @@ var _ = g.Describe("ScyllaCluster", func() {
o.Expect(err).NotTo(o.HaveOccurred())
defer session.Close()

err = wait.PollImmediate(100*time.Millisecond, 5*time.Second, func() (done bool, err error) {
err = wait.PollUntilContextTimeout(ctx, 100*time.Millisecond, 5*time.Second, true, func(context.Context) (done bool, err error) {
return len(connections) == nrShards, nil
})
o.Expect(err).NotTo(o.HaveOccurred())
Expand Down

0 comments on commit 84e7422

Please sign in to comment.