-
Notifications
You must be signed in to change notification settings - Fork 49
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
test(peer-and-connection-management): Implement tests #2566
Conversation
You can find the image built from this PR at
Built from 70cc31e |
bbebbac
to
3cea89b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for that! 🥳
I just added some non-blocking questions. Doubts that I have mostly because I may miss something :)
Aside note: I think we should invest efforts on making xasyncTest
s available. I think you are doing an outstanding work on those and is a pitty that they could get there forgotten. I mean, is great to add TODO
for future revision but I think we should invest some time to fix those
await server2.stop() | ||
|
||
suite "Tracked Peer Metadata": | ||
xasyncTest "Metadata Recording": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, we have a related issue for all those tests labeled as xasyncTest
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
serverPeerStore.get(clientPeerId).connectedness == Connectedness.Connected | ||
|
||
suite "Handling Connections on Different Networks": | ||
# TODO: Implement after discv5 and peer manager's interaction is understood |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can have a 1:1 session next week to try to understand them together :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me :)
let | ||
privKey = generateSecp256k1Key() | ||
extIp = "127.0.0.1" | ||
tcpPort = 61500u16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this case, it cannot connect because the port isn't valid right? If that's the case, maybe interesting to add a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAIK, the port is valid. The reason it can't connect is because that server hasn't been started.
check: | ||
clientPeerStore.peers().len == 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, I was expecting this to be 0
, considering the capacity == 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not following you. Can you repeat?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not following you. Can you repeat?
hahah yes, given that we are setting capacity == 1
I wonder why clientPeerStore.peers().len == 1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it make sense? What would make sense to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't it make sense? What would make sense to you?
Sorry, I expressed myself wrongly and twice.
I mean that, given that we are setting clientPeerStore.capacity = 0
at the beginning of the test, I was expecting that no peers could get connected and therefore, I was expecting this: clientPeerStore.peers().len == 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AlejandroCabeza - could it happen that clientPeerStore.capacity = 0
means unlimited?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually very likely the case, same as with the colocationLimit
.
|
||
# Then the server should have all clients in its peer store | ||
check: | ||
serverPeerStore.peers().len == 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be 0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because colocationLimit == 0
means "unlimited".
2a973bd
to
6cc5401
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work and helpful even just to understand peermanager insights. Thank you!
6cc5401
to
66ae6a6
Compare
You can find the image built from this PR at
Built from 169b604 |
You can find the image built from this PR at
Built from 169b604 |
* Implement peer and connection management tests. * Fix multiple peers added on initialisation. * Remove clusterId parameter from newTestWakuNode.
Description
Implement tests for peer and connection management
Changes
peersByShard
initialisation.clusterId
parameter fromnewTestWakuNode
(unused).NotConnected
onaddPeer
.