Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sud82 committed May 21, 2024
1 parent e3d16f2 commit fa91f83
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 15 deletions.
2 changes: 1 addition & 1 deletion api/v1/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const (
AerospikeInitContainerRegistryEnvVar = "AEROSPIKE_KUBERNETES_INIT_REGISTRY"
AerospikeInitContainerDefaultRegistry = "docker.io"
AerospikeInitContainerDefaultRegistryNamespace = "aerospike"
AerospikeInitContainerDefaultRepoAndTag = "aerospike-kubernetes-init:2.2.0-dev4"
AerospikeInitContainerDefaultRepoAndTag = "aerospike-kubernetes-init:2.2.0"
AerospikeAppLabel = "app"
AerospikeAppLabelValue = "aerospike-cluster"
AerospikeCustomResourceLabel = "aerospike.com/cr"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
toolchain go1.21.8

require (
github.com/aerospike/aerospike-management-lib v1.3.1-0.20240506094830-f70b1a5ea4e7
github.com/aerospike/aerospike-management-lib v1.4.0
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
github.com/evanphx/json-patch v4.12.0+incompatible
github.com/go-logr/logr v1.4.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/aerospike/aerospike-client-go/v7 v7.1.0 h1:yvCTKdbpqZxHvv7sWsFHV1j49jZcC8yXRooWsDFqKtA=
github.com/aerospike/aerospike-client-go/v7 v7.1.0/go.mod h1:AkHiKvCbqa1c16gCNGju3c5X/yzwLVvblNczqjxNwNk=
github.com/aerospike/aerospike-management-lib v1.3.1-0.20240506094830-f70b1a5ea4e7 h1:aeK9T07k3l9Ea/LKnCXKRbVWu+o6rZVpUpGadxEokxA=
github.com/aerospike/aerospike-management-lib v1.3.1-0.20240506094830-f70b1a5ea4e7/go.mod h1:3JKrmC/mLSV8SygbrPQPNV8T7bFaTMjB8wfnX25gB+4=
github.com/aerospike/aerospike-management-lib v1.4.0 h1:wT0l3kwzXv5DV5Cd+hD0BQq3hjSIyaPX1HaUb1304TI=
github.com/aerospike/aerospike-management-lib v1.4.0/go.mod h1:3JKrmC/mLSV8SygbrPQPNV8T7bFaTMjB8wfnX25gB+4=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d h1:Byv0BzEl3/e6D5CLfI0j/7hiIEtvGVFPCZ7Ei2oq8iQ=
Expand Down
7 changes: 4 additions & 3 deletions test/access_control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2221,14 +2221,15 @@ var _ = Describe(
return cerr
}

if !client.IsConnected() {
nodes := client.GetNodeNames()
if len(nodes) == 0 {
return fmt.Errorf("Not connected")
}

pkgLog.Info("Connected to cluster")
pkgLog.Info("Connected to cluster", "nodes", nodes, "pass", pass)

return nil
}, 3*time.Minute).ShouldNot(HaveOccurred())
}, 5*time.Minute).ShouldNot(HaveOccurred())

By("Try scaleup")
err = scaleUpClusterTest(
Expand Down
10 changes: 8 additions & 2 deletions test/large_reconcile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,14 @@ func loadDataInCluster(
return readErr
}

fmt.Printf("Loading record, isClusterConnected %v\n", clientP.IsConnected())
fmt.Println(asClient.GetNodes())
for !asClient.IsConnected() {
pkgLog.Info("Waiting for cluster to connect")
time.Sleep(2 * time.Second)
}

pkgLog.Info(
"Loading record", "nodes", asClient.GetNodeNames(),
)

// The k8s services take time to come up so the timeouts are on the
// higher side.
Expand Down
20 changes: 14 additions & 6 deletions test/storage_wipe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,14 @@ func writeDataToCluster(
return err
}

fmt.Printf(
"Loading record, isClusterConnected %v\n", asClient.IsConnected(),
for !asClient.IsConnected() {
pkgLog.Info("Waiting for cluster to connect")
time.Sleep(2 * time.Second)
}

pkgLog.Info(
"Loading record", "nodes", asClient.GetNodeNames(),
)
fmt.Println(asClient.GetNodes())

wp := as.NewWritePolicy(0, 0)

Expand Down Expand Up @@ -299,10 +303,14 @@ func checkDataInCluster(

defer asClient.Close()

fmt.Printf(
"Loading record, isClusterConnected %v\n", asClient.IsConnected(),
for !asClient.IsConnected() {
pkgLog.Info("Waiting for cluster to connect")
time.Sleep(2 * time.Second)
}

pkgLog.Info(
"Loading record", "nodes", asClient.GetNodeNames(),
)
fmt.Println(asClient.GetNodes())

if _, err = asClient.WarmUp(-1); err != nil {
return nil, err
Expand Down

0 comments on commit fa91f83

Please sign in to comment.