use testing.Cleanup to shut down peerstore and revert most test changes

This commit is contained in:
Marten Seemann
2021-09-07 10:42:50 +01:00
parent 782897ea41
commit a872d26b7c
7 changed files with 29 additions and 53 deletions

View File

@@ -7,12 +7,12 @@ import (
"testing"
"time"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/peerstore"
ma "github.com/multiformats/go-multiaddr"
. "github.com/libp2p/go-libp2p-swarm"
swarmt "github.com/libp2p/go-libp2p-swarm/testing"
"github.com/libp2p/go-libp2p-testing/ci"
)
@@ -24,7 +24,7 @@ func TestSimultOpen(t *testing.T) {
// connect everyone
{
var wg sync.WaitGroup
connect := func(s network.Network, dst peer.ID, addr ma.Multiaddr) {
connect := func(s *Swarm, dst peer.ID, addr ma.Multiaddr) {
defer wg.Done()
// copy for other peer
log.Debugf("TestSimultOpen: connecting: %s --> %s (%s)", s.LocalPeer(), dst, addr)