Parcourir la source

Wait for the pool to settle

Ben Hood il y a 11 ans
Parent
commit
c39269cd08
1 fichiers modifiés avec 5 ajouts et 0 suppressions
  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())
 	}