Skip to content

Commit

Permalink
Remove TestCapabilities_Discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
algorandskiy committed Aug 29, 2024
1 parent c559b8c commit 3395b0c
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions network/p2p/capabilities_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"testing"
"time"

golog "github.com/ipfs/go-log"
"github.com/libp2p/go-libp2p"
dht "github.com/libp2p/go-libp2p-kad-dht"
"github.com/libp2p/go-libp2p/core/discovery"
Expand All @@ -38,42 +37,6 @@ import (
"github.com/algorand/go-algorand/test/partitiontest"
)

func TestCapabilities_Discovery(t *testing.T) {
partitiontest.PartitionTest(t)

golog.SetDebugLogging()
var caps []*CapabilitiesDiscovery
var addrs []peer.AddrInfo
testSize := 3
for i := 0; i < testSize; i++ {
tempdir := t.TempDir()
ps, err := peerstore.NewPeerStore(nil, "")
require.NoError(t, err)
h, _, err := MakeHost(config.GetDefaultLocal(), tempdir, ps)
require.NoError(t, err)
capD, err := MakeCapabilitiesDiscovery(context.Background(), config.GetDefaultLocal(), h, "devtestnet", logging.Base(), func() []peer.AddrInfo { return nil })
require.NoError(t, err)
caps = append(caps, capD)
addrs = append(addrs, peer.AddrInfo{
ID: capD.Host().ID(),
Addrs: capD.Host().Addrs(),
})
}
for _, capD := range caps {
peersAdded := 0
for _, addr := range addrs {
added, err := capD.addPeer(addr)
require.NoError(t, err)
require.True(t, added)
peersAdded++
}
err := capD.dht.Bootstrap(context.Background())
require.NoError(t, err)
capD.dht.ForceRefresh()
require.Equal(t, peersAdded, capD.dht.RoutingTable().Size())
}
}

func setupDHTHosts(t *testing.T, numHosts int) []*dht.IpfsDHT {
var hosts []host.Host
var bootstrapPeers []peer.AddrInfo
Expand Down

0 comments on commit 3395b0c

Please sign in to comment.