mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdserver: fix TestDoProposalStopped test
We start etcd server in this test without the cluster. Sometimes it panics when accessing the cluster. Most of the time it does not panic, since we can stop the server fast enough before applying the first configuration change entry.
This commit is contained in:
parent
fb344bc33f
commit
978d0f1ca1
@ -677,6 +677,8 @@ func TestDoProposalStopped(t *testing.T) {
|
||||
tk := make(chan time.Time)
|
||||
// this makes <-tk always successful, which accelarates internal clock
|
||||
close(tk)
|
||||
cl := newCluster("abc")
|
||||
cl.SetStore(store.New())
|
||||
srv := &EtcdServer{
|
||||
// TODO: use fake node for better testability
|
||||
node: n,
|
||||
@ -684,6 +686,7 @@ func TestDoProposalStopped(t *testing.T) {
|
||||
sender: &nopSender{},
|
||||
storage: &storageRecorder{},
|
||||
Ticker: tk,
|
||||
Cluster: cl,
|
||||
}
|
||||
srv.start()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user