Skip to content

Commit

Permalink
UPSTREAM: <drop>: etcd testing
Browse files Browse the repository at this point in the history
:100644 100644 c02d75b61a... 57990372e8... M	staging/src/k8s.io/apiserver/pkg/storage/etcd/testing/utils.go
  • Loading branch information
soltysh authored and liggitt committed Dec 15, 2017
1 parent 7f4757a commit 0c298c7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
etcd "github.com/coreos/etcd/client"
"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/etcdserver"
"github.com/coreos/etcd/etcdserver/api/etcdhttp"
"github.com/coreos/etcd/etcdserver/api/v2http"
"github.com/coreos/etcd/integration"
"github.com/coreos/etcd/pkg/testutil"
Expand Down Expand Up @@ -169,6 +170,7 @@ func configureTestCluster(t *testing.T, name string, https bool) *EtcdTestServer
if err != nil {
t.Fatal(err)
}
m.AuthToken = "simple"

clusterStr := fmt.Sprintf("%s=http://%s", name, pln.Addr().String())
m.InitialPeerURLsMap, err = types.NewURLsMap(clusterStr)
Expand All @@ -190,9 +192,9 @@ func (m *EtcdTestServer) launch(t *testing.T) error {
if m.s, err = etcdserver.NewServer(&m.ServerConfig); err != nil {
return fmt.Errorf("failed to initialize the etcd server: %v", err)
}
m.s.SyncTicker = time.Tick(500 * time.Millisecond)
m.s.SyncTicker = time.NewTicker(500 * time.Millisecond)
m.s.Start()
m.raftHandler = &testutil.PauseableHandler{Next: v2http.NewPeerHandler(m.s)}
m.raftHandler = &testutil.PauseableHandler{Next: etcdhttp.NewPeerHandler(m.s)}
for _, ln := range m.PeerListeners {
hs := &httptest.Server{
Listener: ln,
Expand Down

0 comments on commit 0c298c7

Please sign in to comment.