-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Randomly fuzz the PSM #2470
Randomly fuzz the PSM #2470
Conversation
| if let Some(id) = incoming_nodes.iter().find(|(_, v)| **v == id).map(|(&id, _)| id) { | ||
| incoming_nodes.remove(&id); | ||
| } | ||
| assert!(connected_nodes.insert(id)); |
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.
I think you might want to change this to assert!(connected_nodes.insert(id) || known_nodes.remove(id));, to account for an Accept message being received after discovered was called?
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.
known_nodes contains all the nodes that have been discovered in the past, not just nodes waiting for connection.
|
@tomaka is this ready for merge? |
No, the test failure is legitimate but I don't know if it's an issue in the tests or in the PSM. |
|
Should be ready now. |
|
CI failure looks unrelated. |
* Randomly fuzz the PSM * Fix test * Run it moar
My take on #2200
Runs the peerset and randomly performs actions on it over time.
I'm aware of the fact that the tests fails, however I'm unsure whether it's the test that is wrong or if it's a bug in the PSM. If possible I'd be asking for reviews to see if what I'm doing is correct.