소스 검색

Merge pull request #498 from Zariel/reinstant-discovery-tests

reenable discovery tests
Chris Bannister 10 년 전
부모
커밋
1355eabb60
1개의 변경된 파일3개의 추가작업 그리고 7개의 파일을 삭제
  1. 3 7
      cassandra_test.go

+ 3 - 7
cassandra_test.go

@@ -177,10 +177,8 @@ func TestRingDiscovery(t *testing.T) {
 	cluster.Hosts = clusterHosts[:1]
 	cluster.DiscoverHosts = true
 
-	session, err := cluster.CreateSession()
-	if err != nil {
-		t.Fatalf("got error connecting to the cluster %v", err)
-	}
+	session := createSessionFromCluster(cluster, t)
+	defer session.Close()
 
 	if *clusterSize > 1 {
 		// wait for autodiscovery to update the pool with the list of known hosts
@@ -192,10 +190,8 @@ func TestRingDiscovery(t *testing.T) {
 	session.pool.mu.RUnlock()
 
 	if *clusterSize != size {
-		t.Logf("WARN: Expected a cluster size of %d, but actual size was %d", *clusterSize, size)
+		t.Fatalf("Expected a cluster size of %d, but actual size was %d", *clusterSize, size)
 	}
-
-	session.Close()
 }
 
 func TestEmptyHosts(t *testing.T) {