mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Fixed test case
This commit is contained in:
parent
46f8a354d1
commit
faab194247
@ -14,6 +14,8 @@ const (
|
|||||||
testClientURL = "localhost:4401"
|
testClientURL = "localhost:4401"
|
||||||
testRaftURL = "localhost:7701"
|
testRaftURL = "localhost:7701"
|
||||||
testSnapshotCount = 10000
|
testSnapshotCount = 10000
|
||||||
|
testHeartbeatTimeout = 50
|
||||||
|
testElectionTimeout = 200
|
||||||
)
|
)
|
||||||
|
|
||||||
// Starts a server in a temporary directory.
|
// Starts a server in a temporary directory.
|
||||||
@ -23,7 +25,7 @@ func RunServer(f func(*server.Server)) {
|
|||||||
|
|
||||||
store := store.New()
|
store := store.New()
|
||||||
registry := server.NewRegistry(store)
|
registry := server.NewRegistry(store)
|
||||||
ps := server.NewPeerServer(testName, path, testRaftURL, testRaftURL, &server.TLSConfig{Scheme: "http"}, &server.TLSInfo{}, registry, store, testSnapshotCount)
|
ps := server.NewPeerServer(testName, path, testRaftURL, testRaftURL, &server.TLSConfig{Scheme: "http"}, &server.TLSInfo{}, registry, store, testSnapshotCount, testHeartbeatTimeout, testElectionTimeout)
|
||||||
s := server.New(testName, testClientURL, testClientURL, &server.TLSConfig{Scheme: "http"}, &server.TLSInfo{}, ps, registry, store)
|
s := server.New(testName, testClientURL, testClientURL, &server.TLSConfig{Scheme: "http"}, &server.TLSInfo{}, ps, registry, store)
|
||||||
ps.SetServer(s)
|
ps.SetServer(s)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user