Skip to content

Commit

Permalink
Merge pull request #10526 from jordanlewis/fix-kv-test
Browse files Browse the repository at this point in the history
sql: don't pass a nil clock in kv_test
  • Loading branch information
jordanlewis authored Nov 8, 2016
2 parents b31cc5b + e955b27 commit 0fec68e
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions pkg/sql/kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@ import (
gosql "database/sql"
"fmt"
"math/rand"
"path/filepath"
"testing"

"golang.org/x/net/context"

"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/internal/client"
"github.com/cockroachdb/cockroach/pkg/rpc"
"github.com/cockroachdb/cockroach/pkg/security"
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/cockroachdb/cockroach/pkg/util/tracing"
"github.com/pkg/errors"
)
Expand All @@ -58,15 +54,11 @@ func newKVNative(b *testing.B) kvInterface {
enableTracing := tracing.Disable()
s, _, _ := serverutils.StartServer(b, base.TestServerArgs{})

// TestServer.DB() returns the TxnCoordSender wrapped client. But that isn't
// a fair comparison with SQL as we want these client requests to be sent
// over the network.
rpcContext := rpc.NewContext(log.AmbientContext{}, &base.Config{
User: security.NodeUser,
SSLCA: filepath.Join(security.EmbeddedCertsDir, security.EmbeddedCACert),
SSLCert: filepath.Join(security.EmbeddedCertsDir, "node.crt"),
SSLCertKey: filepath.Join(security.EmbeddedCertsDir, "node.key"),
}, nil, s.Stopper())
// TestServer.KVClient() returns the TxnCoordSender wrapped client. But that
// isn't a fair comparison with SQL as we want these client requests to be
// sent over the network.
rpcContext := s.RPCContext()

conn, err := rpcContext.GRPCDial(s.ServingAddr())
if err != nil {
b.Fatal(err)
Expand Down

0 comments on commit 0fec68e

Please sign in to comment.