rollback old change & add new

This commit is contained in:
Nikita Stroganov 2023-05-03 08:00:35 +00:00 committed by Fedor Korotkiy
parent 7d285ed7fd
commit 4c51cc9329

View file

@ -95,14 +95,18 @@ func TestGossip_TwoPeers(t *testing.T) {
require.Contains(t, members1, peer0.Addr())
require.Contains(t, members1, peer1.Addr())
peer0.UpdateMeta(&meshpb.PeerMeta{Name: "bob"})
peer1.UpdateMeta(&meshpb.PeerMeta{Name: "bob"})
time.Sleep(waitPeriod)
require.Equal(t, "bob", peer1.GetMembers()[peer0.Addr()].Name)
require.Equal(t, "bob", peer0.GetMembers()[peer1.Addr()].Name)
peer1.UpdateMeta(&meshpb.PeerMeta{Name: "sam"})
time.Sleep(waitPeriod)
require.Equal(t, "sam", peer0.GetMembers()[peer1.Addr()].Name)
peer0.UpdateMeta(&meshpb.PeerMeta{Name: "alice"})
time.Sleep(waitPeriod)
require.Equal(t, "alice", peer1.GetMembers()[peer0.Addr()].Name)
stop1()
time.Sleep(waitPeriod)