Skip to content

Commit

Permalink
fix(tests): panic during sharness
Browse files Browse the repository at this point in the history
  • Loading branch information
lidel committed Apr 23, 2022
1 parent 99f430c commit 187121e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions core/node/libp2p/routing.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ func PubsubRouter(mctx helpers.MetricsCtx, lc fx.Lifecycle, in p2pPSRoutingIn) (
func AutoRelayFeeder(lc fx.Lifecycle, h host.Host, peerChan chan peer.AddrInfo, dht *ddht.DHT) {
ctx, cancel := context.WithCancel(context.Background())

// TODO: refactor AutoRelayFeeder, for now we skip it if dht missing to fix sharness panics
if dht == nil {
return
}

done := make(chan struct{})
go func() {
defer close(done)
Expand Down
1 change: 1 addition & 0 deletions test/sharness/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ lib/sharness/
test-results/
trash directory.*.sh/
plugins
*.DS_Store
2 changes: 1 addition & 1 deletion test/sharness/t0160-resolve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ test_resolve_cmd_b32() {
local self_hash_b32libp2pkey=$(echo $self_hash | ipfs cid format -v 1 -b b --codec libp2p-key)
test_expect_success "resolve of /ipns/{cidv1} with multicodec other than libp2p-key returns a meaningful error" '
test_expect_code 1 ipfs resolve /ipns/$self_hash_b32protobuf 2>cidcodec_error &&
grep "Error: peer ID represented as CIDv1 require libp2p-key multicodec: retry with /ipns/$self_hash_b32libp2pkey" cidcodec_error
test_should_contain "Error: peer ID represented as CIDv1 require libp2p-key multicodec: retry with /ipns/$self_hash_b32libp2pkey" cidcodec_error
'
}

Expand Down

0 comments on commit 187121e

Please sign in to comment.