fix(tests/server_utils): add a metrics bucket
This is required to avoid getting nil pointer exceptions if a peer joins this test server.release-0.4
parent
a8b07b1b48
commit
ff6090836c
|
@ -8,6 +8,7 @@ import (
|
||||||
|
|
||||||
"github.com/coreos/etcd/third_party/github.com/coreos/raft"
|
"github.com/coreos/etcd/third_party/github.com/coreos/raft"
|
||||||
|
|
||||||
|
"github.com/coreos/etcd/metrics"
|
||||||
"github.com/coreos/etcd/server"
|
"github.com/coreos/etcd/server"
|
||||||
"github.com/coreos/etcd/store"
|
"github.com/coreos/etcd/store"
|
||||||
)
|
)
|
||||||
|
@ -39,7 +40,10 @@ func RunServer(f func(*server.Server)) {
|
||||||
SnapshotCount: testSnapshotCount,
|
SnapshotCount: testSnapshotCount,
|
||||||
MaxClusterSize: 9,
|
MaxClusterSize: 9,
|
||||||
}
|
}
|
||||||
ps := server.NewPeerServer(psConfig, registry, store, nil, followersStats, serverStats)
|
|
||||||
|
mb := metrics.NewBucket("")
|
||||||
|
|
||||||
|
ps := server.NewPeerServer(psConfig, registry, store, &mb, followersStats, serverStats)
|
||||||
psListener, err := server.NewListener(testRaftURL)
|
psListener, err := server.NewListener(testRaftURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
|
Loading…
Reference in New Issue