mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #14284 from AustinBenoit/test/server_transport_test_remove
rafthttp: test multiple transport removes
This commit is contained in:
commit
21995a3b76
@ -142,6 +142,25 @@ func TestTransportRemove(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestTransportRemoveIsIdempotent(t *testing.T) {
|
||||
tr := &Transport{
|
||||
LeaderStats: stats.NewLeaderStats(zaptest.NewLogger(t), ""),
|
||||
streamRt: &roundTripperRecorder{},
|
||||
peers: make(map[types.ID]Peer),
|
||||
pipelineProber: probing.NewProber(nil),
|
||||
streamProber: probing.NewProber(nil),
|
||||
}
|
||||
|
||||
tr.AddPeer(1, []string{"http://localhost:2380"})
|
||||
tr.RemovePeer(types.ID(1))
|
||||
tr.RemovePeer(types.ID(1))
|
||||
defer tr.Stop()
|
||||
|
||||
if _, ok := tr.peers[types.ID(1)]; ok {
|
||||
t.Fatalf("senders[1] exists, want removed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestTransportUpdate(t *testing.T) {
|
||||
peer := newFakePeer()
|
||||
tr := &Transport{
|
||||
|
Loading…
x
Reference in New Issue
Block a user