From 4c51cc932991d3bb687af23840259f4662b71284 Mon Sep 17 00:00:00 2001 From: Nikita Stroganov Date: Wed, 3 May 2023 08:00:35 +0000 Subject: [PATCH] rollback old change & add new --- gossip/gossip_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gossip/gossip_test.go b/gossip/gossip_test.go index ce88d16..233b44d 100644 --- a/gossip/gossip_test.go +++ b/gossip/gossip_test.go @@ -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)