Browse Source

Pool.Size() in simple pool returns the number of connections not the number of nodes

Ben Hood 11 năm trước cách đây
mục cha
commit
cd88c627e7
1 tập tin đã thay đổi với 4 bổ sung2 xóa
  1. 4 2
      cassandra_test.go

+ 4 - 2
cassandra_test.go

@@ -135,8 +135,10 @@ func TestRingDiscovery(t *testing.T) {
 		fmt.Printf("(Simple) Pooled peers: %+v\n", pooledPeers)
 	}
 
-	if *clusterSize != session.Pool.Size() {
-		t.Fatalf("Expected a cluster size of %d, but actual size was %d", *clusterSize, session.Pool.Size())
+	size := len(session.Pool.(*SimplePool).connPool)
+
+	if *clusterSize != size {
+		t.Fatalf("Expected a cluster size of %d, but actual size was %d", *clusterSize, size)
 	}
 
 	session.Close()