Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integration test for the dual dht #7151

Merged
merged 7 commits into from
Apr 15, 2020
Merged

integration test for the dual dht #7151

merged 7 commits into from
Apr 15, 2020

Conversation

willscott
Copy link
Contributor

This adds an integration test.

Currently, an *IpfsDHT is exposed by the core, which will not be populated due to the use of the dual DHT. this test will not be able to refresh the routing table as a result, and will fail at present on the feat/dual-dht branch.

@willscott willscott force-pushed the feat/dual-dht-tests branch 2 times, most recently from 764b8be to 4895adc Compare April 14, 2020 15:17
@willscott
Copy link
Contributor Author

the test now passes locally when run with a go-libp2p containing the fix from libp2p/go-libp2p#887

@willscott willscott changed the base branch from feat/dual-dht to master April 15, 2020 18:43
Copy link
Member

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I have some nits but they're not critical.

})

testPeer, err := core.NewNode(ctx, &core.BuildCfg{
Online: true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should start the test peer as a client. Otherwise, the test record could get put on the test peer.

_ = testPeer.PeerHost.Network().ClosePeer(lanPeers[i].Identity)
testPeer.PeerHost.Peerstore().ClearAddrs(lanPeers[i].Identity)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we're trying to find a record, not a peer, this shouldn't be necessary.

_ = testPeer.PeerHost.Network().ClosePeer(wanPeers[i].Identity)
testPeer.PeerHost.Peerstore().ClearAddrs(wanPeers[i].Identity)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto. Now that we're calling FindProviders instead of FendPeer, disconnecting doesn't buy us anything.

@Stebalien Stebalien merged commit 841b62c into master Apr 15, 2020
@hacdias hacdias deleted the feat/dual-dht-tests branch May 9, 2023 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants