File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ module github.com/gocql/gocql
2020go 1.23
2121
2222require (
23- github.com/bitly/go-hostpool v0.1.0 // indirect
24- github.com/docker/docker v27.1.1+incompatible // indirect
2523 github.com/golang/snappy v0.0.4
2624 github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed
2725 github.com/testcontainers/testcontainers-go v0.33.0
@@ -32,13 +30,15 @@ require (
3230 dario.cat/mergo v1.0.0 // indirect
3331 github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
3432 github.com/Microsoft/go-winio v0.6.2 // indirect
33+ github.com/bitly/go-hostpool v0.1.0 // indirect
3534 github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect
3635 github.com/cenkalti/backoff/v4 v4.2.1 // indirect
3736 github.com/containerd/containerd v1.7.18 // indirect
3837 github.com/containerd/log v0.1.0 // indirect
3938 github.com/containerd/platforms v0.2.1 // indirect
4039 github.com/cpuguy83/dockercfg v0.3.1 // indirect
4140 github.com/distribution/reference v0.6.0 // indirect
41+ github.com/docker/docker v27.1.1+incompatible // indirect
4242 github.com/docker/go-connections v0.5.0 // indirect
4343 github.com/docker/go-units v0.5.0 // indirect
4444 github.com/felixge/httpsnoop v1.0.4 // indirect
Original file line number Diff line number Diff line change @@ -272,3 +272,28 @@ func TestUDF(t *testing.T) {
272272 t .Fatal (err )
273273 }
274274}
275+
276+ func TestAllNodesConnected (t * testing.T ) {
277+ cluster := createCluster ()
278+ cluster .PoolConfig .HostSelectionPolicy = RoundRobinHostPolicy ()
279+
280+ session := createSessionFromCluster (cluster , t )
281+ defer session .Close ()
282+
283+ ids := make (map [string ]bool )
284+
285+ // Loop to query system.local multiple times. If there is a cluster with more than 10 nodes add to the loop more iterations
286+ for i := 0 ; i < 10 ; i ++ {
287+ var hostID string
288+ err := session .Query ("SELECT host_id FROM system.local" ).Scan (& hostID )
289+ if err != nil {
290+ t .Fatal (err )
291+ }
292+
293+ ids [hostID ] = true
294+ }
295+
296+ if * clusterSize != len (ids ) {
297+ t .Fatalf ("Expected to connect to %d unique nodes" , * clusterSize )
298+ }
299+ }
You can’t perform that action at this time.
0 commit comments