소스 검색

Debugging for the simple pool

Ben Hood 11 년 전
부모
커밋
58a42819da
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      cassandra_test.go

+ 11 - 0
cassandra_test.go

@@ -124,6 +124,17 @@ func TestRingDiscovery(t *testing.T) {
 		time.Sleep(*flagAutoWait)
 	}
 
+	pool, ok := session.Pool.(*SimplePool)
+	if ok {
+		pooledPeers := make([]string, len(pool.hosts))
+		i := 0
+		for peer, _ := range pool.hosts {
+			pooledPeers[i] = peer
+			i++
+		}
+		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())
 	}