浏览代码

Wait for the pool to settle

Ben Hood 11 年之前
父节点
当前提交
c39269cd08
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      cassandra_test.go

+ 5 - 0
cassandra_test.go

@@ -106,6 +106,11 @@ func TestRingDiscovery(t *testing.T) {
 		t.Errorf("got error connecting to the cluster %v", err)
 	}
 
+	if *clusterSize > 1 {
+		// wait for autodiscovery to update the pool with the list of known hosts
+		time.Sleep(500 * time.Millisecond)
+	}
+
 	if *clusterSize != session.Pool.Size() {
 		t.Fatalf("Expected a cluster size of %d, but actual size was %d", *clusterSize, session.Pool.Size())
 	}