You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: test.rs
    path of file: ./repos/diem/network/src/connectivity_manager
    
    the code of the file until where you have to start completion: // Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0

use super::*;
use crate::{
    peer::DisconnectReason,
    peer_manager::{conn_notifs_channel, ConnectionRequest},
    transport::ConnectionMetadata,
};
use channel::{diem_channel, message_queues::QueueStyle};
use diem_config::config::{Peer, PeerRole, PeerSet, HANDSHAKE_VERSION};
use diem_crypto::{test_utils::TEST_SEED, x25519, Uniform};
use diem_logger::info;
use diem_time_service::{MockTimeService, TimeService};
use diem_types::network_address::NetworkAddress;
use futures::{executor::block_on, future, SinkExt};
use maplit::{hashmap, hashset};
use rand::rngs::StdRng;
use std::{io, str::FromStr};
use tokio_retry::strategy::FixedInterval;

const MAX_TEST_CONNECTIONS: usize = 3;
const CONNECTIVITY_CHECK_INTERVAL: Duration = Duration::from_secs(5);
const CONNECTION_DELAY: Duration = Duration::from_millis(100);
con
    
fn disconnect() {
    let (other_peer_id, other_peer, _, other_addr) = test_peer(0);
    let (mut mock, conn_mgr) = TestHarness::new(HashMap::new());

    let test = async move {
        // Sending pubkey & address of other peer
        let peers = hashmap! {other_peer_id => other_peer.clone()};
        mock.send_update_discovered_peers(DiscoverySource::OnChainValidatorSet, peers)
            .await;

        // Waiting to receive dial request
        mock.trigger_connectivity_check().await;
        mock.trigger_pending_dials().await;
        mock.expect_one_dial_success(other_peer_id, other_addr.clone())
            .await;

        // Sending request to make other peer ineligible (by dropping the key)
        let mut peer = other_peer;
        peer.keys = HashSet::new();
        peer.addresses = vec![network_address(DEFAULT_BASE_ADDR)];

        let peers = hashmap! {other_peer_id => peer};
        mock.send_update_discovered_peers(DiscoverySource::OnChainValidatorSet, peers)
            .await;

        // Peer is now ineligible, we should disconnect from them
        mock.trigger_connectivity_check().await;
        mock.expect_disconnect_success(other_peer_id, other_addr)
            .await;
    };
    block_on(future::join(conn_mgr.start(), test));
}