Explorar o código

Use new createTable() function to avoid timeout

Ben Hood %!s(int64=11) %!d(string=hai) anos
pai
achega
30a3ab10bf
Modificáronse 1 ficheiros con 5 adicións e 4 borrados
  1. 5 4
      cassandra_test.go

+ 5 - 4
cassandra_test.go

@@ -7,10 +7,10 @@ package gocql
 import (
 import (
 	"bytes"
 	"bytes"
 	"flag"
 	"flag"
-	"math"
-	"math/big"
 	"fmt"
 	"fmt"
 	"log"
 	"log"
+	"math"
+	"math/big"
 	"reflect"
 	"reflect"
 	"strconv"
 	"strconv"
 	"strings"
 	"strings"
@@ -30,6 +30,7 @@ var (
 	clusterSize  = 1
 	clusterSize  = 1
 	clusterHosts []string
 	clusterHosts []string
 )
 )
+
 func init() {
 func init() {
 
 
 	flag.Parse()
 	flag.Parse()
@@ -968,8 +969,8 @@ func TestVarint(t *testing.T) {
 	session := createSession(t)
 	session := createSession(t)
 	defer session.Close()
 	defer session.Close()
 
 
-	if err := session.Query("CREATE TABLE varint_test (id varchar, test varint, test2 varint, primary key (id))").Exec(); err != nil {
-		t.Fatal("create table:", err)
+	if err := createTable(session, "CREATE TABLE varint_test (id varchar, test varint, test2 varint, primary key (id))"); err != nil {
+		t.Fatalf("failed to create table with error '%v'", err)
 	}
 	}
 
 
 	if err := session.Query(`INSERT INTO varint_test (id, test) VALUES (?, ?)`, "id", 0).Exec(); err != nil {
 	if err := session.Query(`INSERT INTO varint_test (id, test) VALUES (?, ?)`, "id", 0).Exec(); err != nil {