From 65892d3cdb01654d2c5e85ac2824d58204cf51fb Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Fri, 8 Aug 2014 16:27:48 +0100 Subject: [PATCH 01/17] Use ccm to bing up a cluster of nodes for integration testing --- .travis.yml | 12 +++++++++++- integration.sh | 50 ++++++++++---------------------------------------- 2 files changed, 21 insertions(+), 41 deletions(-) diff --git a/.travis.yml b/.travis.yml index 512e77fdf..3050ae6ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,25 @@ language: go +env: + - CASS=1.2.18 + - CASS=2.0.9 + go: - 1.2 - 1.3 - tip before_script: + - sudo apt-get install -y libjna-java python-pip + - sudo pip install cql PyYAML - go get code.google.com/p/go.tools/cmd/vet + - git clone https://github.com/pcmanus/ccm.git + - pushd ccm + - sudo ./setup.py install + - popd script: - - bash integration.sh + - bash integration.sh $CASS - go vet . notifications: diff --git a/integration.sh b/integration.sh index 91196738b..1da6256ea 100644 --- a/integration.sh +++ b/integration.sh @@ -2,50 +2,20 @@ set -e -PID_FILE=cassandra.pid -STARTUP_LOG=startup.log -ARCHIVE_BASE_URL=http://archive.apache.org/dist/cassandra +function run_tests() { + local version=$1 + ccm create test -v $version -n 3 -s --debug -for v in 1.2.18 2.0.9 -do - TARBALL=apache-cassandra-$v-bin.tar.gz - CASSANDRA_DIR=apache-cassandra-$v + ccm status - curl -L -O $ARCHIVE_BASE_URL/$v/$TARBALL - - if [ ! -f $CASSANDRA_DIR/bin/cassandra ] - then - tar xzf $TARBALL - fi - - CASSANDRA_LOG_DIR=`pwd`/v${v}/log/cassandra - CASSANDRA_LOG=$CASSANDRA_LOG_DIR/system.log - - mkdir -p $CASSANDRA_LOG_DIR - : >$CASSANDRA_LOG # create an empty log file - - sed -i -e 's?/var?'`pwd`/v${v}'?' $CASSANDRA_DIR/conf/cassandra.yaml - sed -i -e 's?/var?'`pwd`/v${v}'?' $CASSANDRA_DIR/conf/log4j-server.properties - - echo "Booting Cassandra ${v}, waiting for CQL listener to start ...." - - $CASSANDRA_DIR/bin/cassandra -p $PID_FILE &> $STARTUP_LOG - - { tail -n +1 -f $CASSANDRA_LOG & } | sed -n '/Starting listening for CQL clients/q' - - PID=$(<"$PID_FILE") - - echo "Cassandra ${v} running (PID ${PID}), about to run test suite ...." - - if [[ $v == 1.2.* ]] - then + if [[ $v == 1.2.* ]]; then go test -v ./... -proto 1 else go test -v ./... fi - echo "Test suite passed against Cassandra ${v}, killing server instance (PID ${PID})" - - kill -9 $PID - rm $PID_FILE -done + ccm stop --not-gently test + ccm remove test +} + +run_tests $1 From 7341c273176ecc2cb8851eff80c79a771508581b Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Fri, 8 Aug 2014 22:09:02 +0100 Subject: [PATCH 02/17] Set timeout, use Quroum, add confiurable replication factor --- cassandra_test.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cassandra_test.go b/cassandra_test.go index db227fc5f..7f7c2b7ea 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -7,20 +7,23 @@ package gocql import ( "bytes" "flag" + "fmt" "reflect" - "speter.net/go/exp/math/dec/inf" "strconv" "strings" "sync" "testing" "time" "unicode" + + "speter.net/go/exp/math/dec/inf" ) var ( flagCluster = flag.String("cluster", "127.0.0.1", "a comma-separated list of host:port tuples") 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") ) var initOnce sync.Once @@ -33,6 +36,8 @@ func createSession(tb testing.TB) *Session { Username: "cassandra", Password: "cassandra", } + cluster.Timeout = 2 * time.Second + cluster.Consistency = Quorum initOnce.Do(func() { session, err := cluster.CreateSession() @@ -44,11 +49,11 @@ func createSession(tb testing.TB) *Session { if err := session.Query(`DROP KEYSPACE gocql_test`).Exec(); err != nil { tb.Log("drop keyspace:", err) } - if err := session.Query(`CREATE KEYSPACE gocql_test + if err := session.Query(fmt.Sprintf(`CREATE KEYSPACE gocql_test WITH replication = { 'class' : 'SimpleStrategy', - 'replication_factor' : 1 - }`).Exec(); err != nil { + 'replication_factor' : %d + }`, *flagRF)).Exec(); err != nil { tb.Fatal("create keyspace:", err) } session.Close() From 4f65494ff3bf6581d315ee221bc53a05f7a4bddd Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Fri, 8 Aug 2014 22:11:43 +0100 Subject: [PATCH 03/17] Fix checking for proto 1 --- integration.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/integration.sh b/integration.sh index 1da6256ea..a746d7026 100644 --- a/integration.sh +++ b/integration.sh @@ -8,14 +8,13 @@ function run_tests() { ccm status - if [[ $v == 1.2.* ]]; then + if [[ $version == 1.2.* ]]; then go test -v ./... -proto 1 else go test -v ./... fi - ccm stop --not-gently test - ccm remove test + ccm clear } run_tests $1 From fefe46175e1295b8015ab0bd94545ced722e099d Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Fri, 8 Aug 2014 22:11:55 +0100 Subject: [PATCH 04/17] Add six --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3050ae6ee..754f87c4e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ go: before_script: - sudo apt-get install -y libjna-java python-pip - - sudo pip install cql PyYAML + - sudo pip install cql PyYAML six - go get code.google.com/p/go.tools/cmd/vet - git clone https://github.com/pcmanus/ccm.git - pushd ccm From 3bcd9d55e8671d7844adc9fcfdb76332528bd325 Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Fri, 8 Aug 2014 23:48:58 +0100 Subject: [PATCH 05/17] debug --- integration.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration.sh b/integration.sh index a746d7026..d6d1d7800 100644 --- a/integration.sh +++ b/integration.sh @@ -9,8 +9,10 @@ function run_tests() { ccm status if [[ $version == 1.2.* ]]; then + echo "running protocol 1 test suite" go test -v ./... -proto 1 else + echo "running protocol 2 test suite" go test -v ./... fi From c9f797ecef41ede5c881d449b65a5f192dc4de58 Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Sat, 9 Aug 2014 13:43:42 +0100 Subject: [PATCH 06/17] Update ccm and test run args --- integration.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/integration.sh b/integration.sh index d6d1d7800..a63fcdd1f 100644 --- a/integration.sh +++ b/integration.sh @@ -4,18 +4,17 @@ set -e function run_tests() { local version=$1 - ccm create test -v $version -n 3 -s --debug + ccm create test -v $version -n 3 -s -d --vnodes ccm status + local proto=2 if [[ $version == 1.2.* ]]; then - echo "running protocol 1 test suite" - go test -v ./... -proto 1 - else - echo "running protocol 2 test suite" - go test -v ./... + proto=1 fi + go test -v -proto=$proto -rf=3 -cluster=$(ccm liveset) ./... + ccm clear } From 4be7ced38a38797ff2a4cbcd47ed65d6219b1429 Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Sat, 9 Aug 2014 13:44:46 +0100 Subject: [PATCH 07/17] Add replication factor flag and pre parse the cluster hosts --- cassandra_test.go | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/cassandra_test.go b/cassandra_test.go index 7f7c2b7ea..588e66639 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -8,6 +8,7 @@ import ( "bytes" "flag" "fmt" + "log" "reflect" "strconv" "strings" @@ -20,16 +21,24 @@ import ( ) var ( - flagCluster = flag.String("cluster", "127.0.0.1", "a comma-separated list of host:port tuples") - 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") + flagCluster = flag.String("cluster", "127.0.0.1", "a comma-separated list of host:port tuples") + 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") + clusterSize = 1 + clusterHosts []string ) +func init() { + clusterHosts = strings.Split(*flagCluster, ",") + clusterSize = len(clusterHosts) + log.SetFlags(log.Lshortfile | log.LstdFlags) +} + var initOnce sync.Once func createSession(tb testing.TB) *Session { - cluster := NewCluster(strings.Split(*flagCluster, ",")...) + cluster := NewCluster(clusterHosts...) cluster.ProtoVersion = *flagProto cluster.CQLVersion = *flagCQL cluster.Authenticator = PasswordAuthenticator{ @@ -53,9 +62,10 @@ func createSession(tb testing.TB) *Session { WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : %d - }`, *flagRF)).Exec(); err != nil { + }`, *flagRF)).Consistency(All).Exec(); err != nil { tb.Fatal("create keyspace:", err) } + tb.Log("Created keyspace") session.Close() }) cluster.Keyspace = "gocql_test" @@ -91,7 +101,7 @@ func TestUseStatementError(t *testing.T) { //TestInvalidKeyspace checks that an invalid keyspace will return promptly and without a flood of connections func TestInvalidKeyspace(t *testing.T) { - cluster := NewCluster(strings.Split(*flagCluster, ",")...) + cluster := NewCluster(clusterHosts...) cluster.ProtoVersion = *flagProto cluster.CQLVersion = *flagCQL cluster.Keyspace = "invalidKeyspace" From 7954fccb3ca773bc296a0061b8a0e40ae8b225d8 Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Sat, 9 Aug 2014 13:45:47 +0100 Subject: [PATCH 08/17] Remove the authenticator, increase timeout, add retry policy as ccm seems flaky --- cassandra_test.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cassandra_test.go b/cassandra_test.go index 588e66639..6173d2bea 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -41,12 +41,9 @@ func createSession(tb testing.TB) *Session { cluster := NewCluster(clusterHosts...) cluster.ProtoVersion = *flagProto cluster.CQLVersion = *flagCQL - cluster.Authenticator = PasswordAuthenticator{ - Username: "cassandra", - Password: "cassandra", - } - cluster.Timeout = 2 * time.Second + cluster.Timeout = 5 * time.Second cluster.Consistency = Quorum + cluster.RetryPolicy.NumRetries = 2 initOnce.Do(func() { session, err := cluster.CreateSession() From ebcbc994de05d54b7723b120a3d67df34f72ff32 Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Sat, 9 Aug 2014 13:46:26 +0100 Subject: [PATCH 09/17] Add a method to create tables to let the schema propogate to other nodes --- cassandra_test.go | 53 +++++++++++++++++++++++++++-------------------- wiki_test.go | 4 ++-- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/cassandra_test.go b/cassandra_test.go index 6173d2bea..9b5916199 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -37,6 +37,15 @@ func init() { var initOnce sync.Once +func createTable(s *Session, table string) error { + err := s.Query(table).Consistency(All).Exec() + if clusterSize > 1 { + // wait for table definition to propogate + time.Sleep(250 * time.Millisecond) + } + return err +} + func createSession(tb testing.TB) *Session { cluster := NewCluster(clusterHosts...) cluster.ProtoVersion = *flagProto @@ -117,7 +126,7 @@ func TestTracing(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query(`CREATE TABLE trace (id int primary key)`).Exec(); err != nil { + if err := createTable(session, `CREATE TABLE trace (id int primary key)`); err != nil { t.Fatal("create:", err) } @@ -149,7 +158,7 @@ func TestPaging(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query("CREATE TABLE paging (id int primary key)").Exec(); err != nil { + if err := createTable(session, "CREATE TABLE paging (id int primary key)"); err != nil { t.Fatal("create table:", err) } for i := 0; i < 100; i++ { @@ -180,11 +189,11 @@ func TestCAS(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query(`CREATE TABLE cas_table ( + if err := createTable(session, `CREATE TABLE cas_table ( title varchar, revid timeuuid, PRIMARY KEY (title, revid) - )`).Exec(); err != nil { + )`); err != nil { t.Fatal("create:", err) } @@ -219,7 +228,7 @@ func TestBatch(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query(`CREATE TABLE batch_table (id int primary key)`).Exec(); err != nil { + if err := createTable(session, `CREATE TABLE batch_table (id int primary key)`); err != nil { t.Fatal("create table:", err) } @@ -248,7 +257,7 @@ func TestBatchLimit(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query(`CREATE TABLE batch_table2 (id int primary key)`).Exec(); err != nil { + if err := createTable(session, `CREATE TABLE batch_table2 (id int primary key)`); err != nil { t.Fatal("create table:", err) } @@ -271,7 +280,7 @@ func TestTooManyQueryArgs(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query(`CREATE TABLE too_many_query_args (id int primary key, value int)`).Exec(); err != nil { + if err := createTable(session, `CREATE TABLE too_many_query_args (id int primary key, value int)`); err != nil { t.Fatal("create table:", err) } @@ -308,7 +317,7 @@ func TestNotEnoughQueryArgs(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query(`CREATE TABLE not_enough_query_args (id int, cluster int, value int, primary key (id, cluster))`).Exec(); err != nil { + if err := createTable(session, `CREATE TABLE not_enough_query_args (id int, cluster int, value int, primary key (id, cluster))`); err != nil { t.Fatal("create table:", err) } @@ -356,7 +365,7 @@ func TestCreateSessionTimeout(t *testing.T) { func TestSliceMap(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query(`CREATE TABLE slice_map_table ( + if err := createTable(session, `CREATE TABLE slice_map_table ( testuuid timeuuid PRIMARY KEY, testtimestamp timestamp, testvarchar varchar, @@ -369,7 +378,7 @@ func TestSliceMap(t *testing.T) { testdecimal decimal, testset set, testmap map - )`).Exec(); err != nil { + )`); err != nil { t.Fatal("create table:", err) } m := make(map[string]interface{}) @@ -488,11 +497,11 @@ func TestScanWithNilArguments(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query(`CREATE TABLE scan_with_nil_arguments ( + if err := createTable(session, `CREATE TABLE scan_with_nil_arguments ( foo varchar, bar int, PRIMARY KEY (foo, bar) - )`).Exec(); err != nil { + )`); err != nil { t.Fatal("create:", err) } for i := 1; i <= 20; i++ { @@ -524,11 +533,11 @@ func TestScanCASWithNilArguments(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query(`CREATE TABLE scan_cas_with_nil_arguments ( + if err := createTable(session, `CREATE TABLE scan_cas_with_nil_arguments ( foo varchar, bar varchar, PRIMARY KEY (foo, bar) - )`).Exec(); err != nil { + )`); err != nil { t.Fatal("create:", err) } @@ -568,7 +577,7 @@ func TestRebindQueryInfo(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query("CREATE TABLE rebind_query (id int, value text, PRIMARY KEY (id))").Exec(); err != nil { + if err := createTable(session, "CREATE TABLE rebind_query (id int, value text, PRIMARY KEY (id))"); err != nil { t.Fatalf("failed to create table with error '%v'", err) } @@ -608,7 +617,7 @@ func TestStaticQueryInfo(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query("CREATE TABLE static_query_info (id int, value text, PRIMARY KEY (id))").Exec(); err != nil { + if err := createTable(session, "CREATE TABLE static_query_info (id int, value text, PRIMARY KEY (id))"); err != nil { t.Fatalf("failed to create table with error '%v'", err) } @@ -677,7 +686,7 @@ func TestBoundQueryInfo(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query("CREATE TABLE clustered_query_info (id int, cluster int, value text, PRIMARY KEY (id, cluster))").Exec(); err != nil { + if err := createTable(session, "CREATE TABLE clustered_query_info (id int, cluster int, value text, PRIMARY KEY (id, cluster))"); err != nil { t.Fatalf("failed to create table with error '%v'", err) } @@ -720,7 +729,7 @@ func TestBatchQueryInfo(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query("CREATE TABLE batch_query_info (id int, cluster int, value text, PRIMARY KEY (id, cluster))").Exec(); err != nil { + if err := createTable(session, "CREATE TABLE batch_query_info (id int, cluster int, value text, PRIMARY KEY (id, cluster))"); err != nil { t.Fatalf("failed to create table with error '%v'", err) } @@ -765,11 +774,11 @@ func TestBatchQueryInfo(t *testing.T) { } func injectInvalidPreparedStatement(t *testing.T, session *Session, table string) (string, *Conn) { - if err := session.Query(`CREATE TABLE ` + table + ` ( + if err := createTable(session, `CREATE TABLE `+table+` ( foo varchar, bar int, PRIMARY KEY (foo, bar) - )`).Exec(); err != nil { + )`); err != nil { t.Fatal("create:", err) } stmt := "INSERT INTO " + table + " (foo, bar) VALUES (?, 7)" @@ -847,7 +856,7 @@ func TestPreparedCacheEviction(t *testing.T) { stmtsLRU.Max(4) stmtsLRU.mu.Unlock() - if err := session.Query("CREATE TABLE prepcachetest (id int,mod int,PRIMARY KEY (id))").Exec(); err != nil { + if err := createTable(session, "CREATE TABLE prepcachetest (id int,mod int,PRIMARY KEY (id))"); err != nil { t.Fatalf("failed to create table with error '%v'", err) } //Fill the table @@ -929,7 +938,7 @@ func TestMarshalFloat64Ptr(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query("CREATE TABLE float_test (id double, test double, primary key (id))").Exec(); err != nil { + if err := createTable(session, "CREATE TABLE float_test (id double, test double, primary key (id))"); err != nil { t.Fatal("create table:", err) } testNum := float64(7500) diff --git a/wiki_test.go b/wiki_test.go index 264a91188..9748cdef4 100644 --- a/wiki_test.go +++ b/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 := w.session.Query(`CREATE TABLE wiki_page ( + if err := createTable(w.session, `CREATE TABLE wiki_page ( title varchar, revid timeuuid, body varchar, @@ -69,7 +69,7 @@ func (w *WikiTest) CreateSchema() { tags set, attachments map, PRIMARY KEY (title, revid) - )`).Exec(); err != nil { + )`); err != nil { w.tb.Fatal("CreateSchema:", err) } } From 0acbc741f576903ea07f666439e0f7b27bb92d56 Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Sat, 9 Aug 2014 14:02:22 +0100 Subject: [PATCH 10/17] Tune config down a little --- integration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration.sh b/integration.sh index a63fcdd1f..400fa4265 100644 --- a/integration.sh +++ b/integration.sh @@ -5,8 +5,8 @@ set -e function run_tests() { local version=$1 ccm create test -v $version -n 3 -s -d --vnodes - ccm status + ccm updateconf 'concurrent_reads: 8' 'concurrent_writes: 8' 'rpc_server_type: hsha' 'rpc_min_threads: 2' 'rpc_max_threads: 8' 'write_request_timeout_in_ms: 5000' local proto=2 if [[ $version == 1.2.* ]]; then From 35676d3704bf8dc6933c781a5227cb662efa133f Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Sat, 9 Aug 2014 14:16:35 +0100 Subject: [PATCH 11/17] tune down further --- integration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration.sh b/integration.sh index 400fa4265..ae3215832 100644 --- a/integration.sh +++ b/integration.sh @@ -6,7 +6,7 @@ function run_tests() { local version=$1 ccm create test -v $version -n 3 -s -d --vnodes ccm status - ccm updateconf 'concurrent_reads: 8' 'concurrent_writes: 8' 'rpc_server_type: hsha' 'rpc_min_threads: 2' 'rpc_max_threads: 8' 'write_request_timeout_in_ms: 5000' + ccm updateconf 'concurrent_reads: 4' 'concurrent_writes: 4' 'rpc_server_type: hsha' 'rpc_min_threads: 2' 'rpc_max_threads: 8' 'write_request_timeout_in_ms: 10000' 'read_request_timeout_in_ms: 10000' local proto=2 if [[ $version == 1.2.* ]]; then From 3d8a4fe9f9491e00a5a2098cdb9aeaa9054df6f3 Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Sat, 9 Aug 2014 14:29:03 +0100 Subject: [PATCH 12/17] Disable compaction --- integration.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/integration.sh b/integration.sh index ae3215832..471cd1c87 100644 --- a/integration.sh +++ b/integration.sh @@ -6,7 +6,11 @@ function run_tests() { local version=$1 ccm create test -v $version -n 3 -s -d --vnodes ccm status - ccm updateconf 'concurrent_reads: 4' 'concurrent_writes: 4' 'rpc_server_type: hsha' 'rpc_min_threads: 2' 'rpc_max_threads: 8' 'write_request_timeout_in_ms: 10000' 'read_request_timeout_in_ms: 10000' + ccm updateconf 'concurrent_reads: 4' 'concurrent_writes: 4' 'rpc_server_type: hsha' 'rpc_min_threads: 2' 'rpc_max_threads: 8' 'write_request_timeout_in_ms: 5000' 'read_request_timeout_in_ms: 5000' + + ccm node1 nodetool disableautocompaction + ccm node2 nodetool disableautocompaction + ccm node3 nodetool disableautocompaction local proto=2 if [[ $version == 1.2.* ]]; then From c1726b2d4001598707764047527ef7f77654a17a Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Sat, 9 Aug 2014 15:49:05 +0100 Subject: [PATCH 13/17] Tweak config --- integration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration.sh b/integration.sh index 471cd1c87..58e72e735 100644 --- a/integration.sh +++ b/integration.sh @@ -6,7 +6,7 @@ function run_tests() { local version=$1 ccm create test -v $version -n 3 -s -d --vnodes ccm status - ccm updateconf 'concurrent_reads: 4' 'concurrent_writes: 4' 'rpc_server_type: hsha' 'rpc_min_threads: 2' 'rpc_max_threads: 8' 'write_request_timeout_in_ms: 5000' 'read_request_timeout_in_ms: 5000' + 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' ccm node1 nodetool disableautocompaction ccm node2 nodetool disableautocompaction From f34c6c3fc37ea4b40b279772b1af611298278b6f Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Sat, 9 Aug 2014 15:56:43 +0100 Subject: [PATCH 14/17] Skip ConnClosing for now --- conn_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/conn_test.go b/conn_test.go index 200b168b5..30adbaa71 100644 --- a/conn_test.go +++ b/conn_test.go @@ -159,6 +159,7 @@ func TestRoundRobin(t *testing.T) { } func TestConnClosing(t *testing.T) { + t.Skip("Skipping until test can be ran reliably") srv := NewTestServer(t) defer srv.Stop() From 685061926838dd9d70cf84c8eb4c43ed82005423 Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Sat, 9 Aug 2014 16:00:02 +0100 Subject: [PATCH 15/17] Remove disable auto compaction for now --- integration.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/integration.sh b/integration.sh index 58e72e735..44e18b51c 100644 --- a/integration.sh +++ b/integration.sh @@ -7,10 +7,6 @@ function run_tests() { ccm create test -v $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' - - ccm node1 nodetool disableautocompaction - ccm node2 nodetool disableautocompaction - ccm node3 nodetool disableautocompaction local proto=2 if [[ $version == 1.2.* ]]; then From 93e6f50e6965cabcd73dfb299e4609372758e8d9 Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Mon, 11 Aug 2014 10:49:37 +0100 Subject: [PATCH 16/17] Parse the test flags --- cassandra_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cassandra_test.go b/cassandra_test.go index 9b5916199..f8ee3bb78 100644 --- a/cassandra_test.go +++ b/cassandra_test.go @@ -30,6 +30,7 @@ var ( ) func init() { + flag.Parse() clusterHosts = strings.Split(*flagCluster, ",") clusterSize = len(clusterHosts) log.SetFlags(log.Lshortfile | log.LstdFlags) From 0a1aa59798140d55345c4c4484cc1962d418da62 Mon Sep 17 00:00:00 2001 From: Chris Bannister Date: Mon, 11 Aug 2014 12:16:59 +0100 Subject: [PATCH 17/17] Use createTable to create tables, this test is slightly racy with > 1 node --- errors_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/errors_test.go b/errors_test.go index bc3becde0..b397f8bb9 100644 --- a/errors_test.go +++ b/errors_test.go @@ -8,11 +8,11 @@ func TestErrorsParse(t *testing.T) { session := createSession(t) defer session.Close() - if err := session.Query(`CREATE TABLE errors_parse (id int primary key)`).Exec(); err != nil { + if err := createTable(session, `CREATE TABLE errors_parse (id int primary key)`); err != nil { t.Fatal("create:", err) } - if err := session.Query(`CREATE TABLE errors_parse (id int primary key)`).Exec(); err == nil { + if err := createTable(session, `CREATE TABLE errors_parse (id int primary key)`); err == nil { t.Fatal("Should have gotten already exists error from cassandra server.") } else { switch e := err.(type) {