etcdserver: not add sender when it has existed

This commit is contained in:
Yicheng Qin
2014-11-07 13:59:48 -08:00
parent d3fd10798b
commit 46cbfbc630
2 changed files with 9 additions and 0 deletions

View File

@ -61,6 +61,12 @@ func TestSendHubAdd(t *testing.T) {
if s.u != "http://a/raft" {
t.Errorf("url = %s, want %s", s.u, "http://a/raft")
}
h.Add(m)
ns := h.senders[types.ID(1)]
if s != ns {
t.Errorf("sender = %p, want %p", ns, s)
}
}
func TestSendHubRemove(t *testing.T) {