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_region_heartbeat.rs
    path of file: ./repos/tikv/tests/integrations/raftstore
    
    the code of the file until where you have to start completion: // Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0.

use std::{
    sync::{mpsc, Arc},
    thread::sleep,
    time::Duration,
};

use engine_rocks::RocksEngine;
use test_raftstore::*;
use test_raftstore_macro::test_case;
use tikv_util::{
    config::*,
    time::{Instant, UnixSecs as PdInstant},
    HandyRwLock,
};

macro_rules! test_down_peers {
    ($cluster:expr) => {
        // depress false-positive warning.
        #[allow(clippy::unnecessary_mut_passed)]
        {
            $cluster.cfg.raft_store.max_peer_down_duration = ReadableDuration::secs(1);
            $cluster.run();

            // Kill 1, 2
            for len in 1..3 {
                let id = len;
                $cluster.stop_node(id);
             
    
fn test_region_heartbeat_timestamp() {
    let mut cluster = new_server_cluster(0, 3);
    cluster.run();

    // transfer leader to (2, 2) first to make address resolve happen early.
    cluster.must_transfer_leader(1, new_peer(2, 2));
    let reported_ts = cluster.pd_client.get_region_last_report_ts(1).unwrap();
    assert_ne!(reported_ts, PdInstant::zero());

    sleep(Duration::from_millis(1000));
    cluster.must_transfer_leader(1, new_peer(1, 1));
    sleep(Duration::from_millis(1000));
    cluster.must_transfer_leader(1, new_peer(2, 2));
    for _ in 0..100 {
        sleep_ms(100);
        let reported_ts_now = cluster.pd_client.get_region_last_report_ts(1).unwrap();
        if reported_ts_now > reported_ts {
            return;
        }
    }
    panic!("reported ts should be updated");
}