Skip to content

Commit

Permalink
Fix logging issues in TestSpacemeshApp_NodeService
Browse files Browse the repository at this point in the history
  • Loading branch information
fasmat committed Aug 1, 2023
1 parent c3b7250 commit df19596
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
10 changes: 0 additions & 10 deletions node/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import (
"github.com/spacemeshos/go-spacemesh/log/logtest"
"github.com/spacemeshos/go-spacemesh/p2p"
"github.com/spacemeshos/go-spacemesh/signing"
"github.com/spacemeshos/go-spacemesh/timesync"
)

const layersPerEpoch = 3
Expand Down Expand Up @@ -421,15 +420,6 @@ func TestSpacemeshApp_NodeService(t *testing.T) {
app.Config.SMESHING.CoinbaseAccount = types.GenerateAddress([]byte{1}).String()
app.Config.SMESHING.Opts.DataDir = t.TempDir()

clock, err := timesync.NewClock(
timesync.WithLayerDuration(1*time.Second),
timesync.WithTickInterval(100*time.Millisecond),
timesync.WithGenesisTime(time.Now()),
timesync.WithLogger(logger),
)
require.NoError(t, err)
app.clock = clock

edSgn, err := signing.NewEdSigner()
require.NoError(t, err)
app.edSgn = edSgn
Expand Down
3 changes: 3 additions & 0 deletions p2p/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import (
"sync"
"time"

lp2plog "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p/core/host"
"github.com/libp2p/go-libp2p/core/network"
"go.uber.org/zap/zapcore"
"golang.org/x/sync/errgroup"

"github.com/spacemeshos/go-spacemesh/log"
Expand Down Expand Up @@ -194,5 +196,6 @@ func (fh *Host) Stop() error {
if err := fh.Host.Close(); err != nil {
return fmt.Errorf("failed to close libp2p host: %w", err)
}
lp2plog.SetPrimaryCore(zapcore.NewNopCore())
return nil
}

0 comments on commit df19596

Please sign in to comment.