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

migrated connect_to_unbanned_peer test #8196

Merged
merged 8 commits into from
Dec 12, 2022
Merged

migrated connect_to_unbanned_peer test #8196

merged 8 commits into from
Dec 12, 2022

Conversation

pompon0
Copy link
Contributor

@pompon0 pompon0 commented Dec 9, 2022

Migrated connect_to_unbanned_peer test from integration-tests to near-network.
It was flaky when executed in presubmit. I've made it more synchronized and faked out time, so now it shouldn't cause problems any more. I've tested it locally for flakiness (multiple concurrent runs in a loop) and observed no problems.

To accomodate the test logic, I reorganized a bit the implementation of some PeerStore methods, but no semantic change was introduced there.

@pompon0 pompon0 requested a review from a team as a code owner December 9, 2022 11:28
@pompon0 pompon0 requested review from mzhangmzz, saketh-are and mm-near and removed request for mzhangmzz December 9, 2022 11:28
if let Err(err) = self.state.peer_store.update_connected_peers_last_seen(&self.clock) {
tracing::error!(target: "network", ?err, "Failed to update peers last seen time.");
}
self.state.peer_store.update(&self.clock);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a nice simplification moving all the updates to one function.

@@ -100,7 +100,7 @@ pub(crate) enum ClosingReason {
#[error("Received a message of type not allowed on this connection.")]
DisallowedMessage,
#[error("PeerManager requested to close the connection")]
PeerManager,
PeerManagerRequest,
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

tracing::info!(target:"test", "pm0 reconnects to pm1");
pm0.connect_to(&pm1.peer_info(), tcp::Tier::T2).await;

drop(pm0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it necessary to drop these manually?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

here is the context:

// These drop() calls fix the place at which we want the values to be dropped,

Copy link
Contributor

@mm-near mm-near left a comment

Choose a reason for hiding this comment

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

Big thank you for improving the reliability of our tests.

chain/network/src/peer_manager/peer_store/mod.rs Outdated Show resolved Hide resolved
chain/network/src/peer_manager/peer_store/mod.rs Outdated Show resolved Hide resolved
chain/network/src/peer_manager/peer_store/mod.rs Outdated Show resolved Hide resolved
chain/network/src/peer_manager/tests/routing.rs Outdated Show resolved Hide resolved
@near-bulldozer near-bulldozer bot merged commit 783658f into master Dec 12, 2022
@near-bulldozer near-bulldozer bot deleted the gprusak-flaky branch December 12, 2022 11:50
nikurt pushed a commit to nikurt/nearcore that referenced this pull request Dec 14, 2022
Migrated connect_to_unbanned_peer test from integration-tests to near-network.
It was flaky when executed in presubmit. I've made it more synchronized and faked out time, so now it shouldn't cause problems any more. I've tested it locally for flakiness (multiple concurrent runs in a loop) and observed no problems.

To accomodate the test logic, I reorganized a bit the implementation of some PeerStore methods, but no semantic change was introduced there.
nikurt pushed a commit to nikurt/nearcore that referenced this pull request Dec 23, 2022
Migrated connect_to_unbanned_peer test from integration-tests to near-network.
It was flaky when executed in presubmit. I've made it more synchronized and faked out time, so now it shouldn't cause problems any more. I've tested it locally for flakiness (multiple concurrent runs in a loop) and observed no problems.

To accomodate the test logic, I reorganized a bit the implementation of some PeerStore methods, but no semantic change was introduced there.
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.

3 participants