فهرست منبع

Make pause for autodiscovery configurable via a flag

Ben Hood 11 سال پیش
والد
کامیت
9596be1685
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  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")
 	clusterSize  = flag.Int("clusterSize", 1, "the expected size of the cluster")
 	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
 )
 
@@ -108,7 +109,7 @@ func TestRingDiscovery(t *testing.T) {
 
 	if *clusterSize > 1 {
 		// 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() {