Browse Source

Make pause for autodiscovery configurable via a flag

Ben Hood 11 years ago
parent
commit
9596be1685
1 changed files with 2 additions and 1 deletions
  1. 2 1
      cassandra_test.go

+ 2 - 1
cassandra_test.go

@@ -29,6 +29,7 @@ var (
 	flagRF       = flag.Int("rf", 1, "replication factor for test keyspace")
 	flagRF       = flag.Int("rf", 1, "replication factor for test keyspace")
 	clusterSize  = flag.Int("clusterSize", 1, "the expected size of the cluster")
 	clusterSize  = flag.Int("clusterSize", 1, "the expected size of the cluster")
 	flagRetry    = flag.Int("retries", 5, "number of times to retry queries")
 	flagRetry    = flag.Int("retries", 5, "number of times to retry queries")
+	flagAutoWait = flag.Duration("autowait", 1000, "milliseconds to wait for autodiscovery to fill the hosts poll")
 	clusterHosts []string
 	clusterHosts []string
 )
 )
 
 
@@ -108,7 +109,7 @@ func TestRingDiscovery(t *testing.T) {
 
 
 	if *clusterSize > 1 {
 	if *clusterSize > 1 {
 		// wait for autodiscovery to update the pool with the list of known hosts
 		// wait for autodiscovery to update the pool with the list of known hosts
-		time.Sleep(500 * time.Millisecond)
+		time.Sleep(*flagAutoWait * time.Millisecond)
 	}
 	}
 
 
 	if *clusterSize != session.Pool.Size() {
 	if *clusterSize != session.Pool.Size() {