Prechádzať zdrojové kódy

Merge pull request #226 from relops/ccm_binary

Binary ccm
Ben Hood 11 rokov pred
rodič
commit
cd28c2e77b
3 zmenil súbory, kde vykonal 10 pridanie a 4 odobranie
  1. 2 1
      cassandra_test.go
  2. 1 1
      integration.sh
  3. 7 2
      wiki_test.go

+ 2 - 1
cassandra_test.go

@@ -27,6 +27,7 @@ var (
 	flagProto    = flag.Int("proto", 2, "protcol version")
 	flagCQL      = flag.String("cql", "3.0.0", "CQL version")
 	flagRF       = flag.Int("rf", 1, "replication factor for test keyspace")
+	flagRetry    = flag.Int("retries", 5, "number of times to retry queries")
 	clusterSize  = 1
 	clusterHosts []string
 )
@@ -56,7 +57,7 @@ func createSession(tb testing.TB) *Session {
 	cluster.CQLVersion = *flagCQL
 	cluster.Timeout = 5 * time.Second
 	cluster.Consistency = Quorum
-	cluster.RetryPolicy.NumRetries = 2
+	cluster.RetryPolicy.NumRetries = *flagRetry
 
 	initOnce.Do(func() {
 		session, err := cluster.CreateSession()

+ 1 - 1
integration.sh

@@ -4,7 +4,7 @@ set -e
 
 function run_tests() {
 	local version=$1
-	ccm create test -v $version -n 3 -s -d --vnodes
+	ccm create test -v binary:$version -n 3 -s -d --vnodes
 	ccm status
 	ccm updateconf 'concurrent_reads: 8' 'concurrent_writes: 32' 'rpc_server_type: sync' 'rpc_min_threads: 2' 'rpc_max_threads: 8' 'write_request_timeout_in_ms: 5000' 'read_request_timeout_in_ms: 5000'
 

+ 7 - 2
wiki_test.go

@@ -58,7 +58,7 @@ func (w *WikiTest) CreateSchema() {
 	if err := w.session.Query(`DROP TABLE wiki_page`).Exec(); err != nil && err.Error() != "unconfigured columnfamily wiki_page" {
 		w.tb.Fatal("CreateSchema:", err)
 	}
-	if err := createTable(w.session, `CREATE TABLE wiki_page (
+	err := createTable(w.session, `CREATE TABLE wiki_page (
 			title       varchar,
 			revid       timeuuid,
 			body        varchar,
@@ -69,7 +69,12 @@ func (w *WikiTest) CreateSchema() {
 			tags        set<varchar>,
 			attachments map<varchar, blob>,
 			PRIMARY KEY (title, revid)
-		)`); err != nil {
+		)`)
+	if clusterSize > 1 {
+		// wait for table definition to propogate
+		time.Sleep(250 * time.Millisecond)
+	}
+	if err != nil {
 		w.tb.Fatal("CreateSchema:", err)
 	}
 }