瀏覽代碼

disable schema events so we dont clear the prepared cache

Chris Bannister 10 年之前
父節點
當前提交
7b1500172e
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      cassandra_test.go

+ 6 - 2
cassandra_test.go

@@ -1090,9 +1090,13 @@ func TestQueryInfo(t *testing.T) {
 
 //TestPreparedCacheEviction will make sure that the cache size is maintained
 func TestPreparedCacheEviction(t *testing.T) {
-	session := createSession(t)
+	const maxPrepared = 4
+	cluster := createCluster()
+	cluster.MaxPreparedStmts = maxPrepared
+	cluster.Events.DisableSchemaEvents = true
+
+	session := createSessionFromCluster(cluster, t)
 	defer session.Close()
-	session.stmtsLRU.max(4)
 
 	if err := createTable(session, "CREATE TABLE gocql_test.prepcachetest (id int,mod int,PRIMARY KEY (id))"); err != nil {
 		t.Fatalf("failed to create table with error '%v'", err)