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: mod.rs
    path of file: ./repos/nearcore/chain/epoch-manager/src/tests
    
    the code of the file until where you have to start completion: mod random_epochs;

use super::*;
use crate::reward_calculator::NUM_NS_IN_SECOND;
use crate::test_utils::{
    block_info, change_stake, default_reward_calculator, epoch_config,
    epoch_config_with_production_config, epoch_info, epoch_info_with_num_seats, hash_range,
    record_block, record_block_with_final_block_hash, record_block_with_slashes,
    record_with_block_info, reward, setup_default_epoch_manager, setup_epoch_manager, stake,
    DEFAULT_TOTAL_SUPPLY,
};
use near_o11y::testonly::init_test_logger;
use near_primitives::account::id::AccountIdRef;
use near_primitives::block::Tip;
use near_primitives::challenge::SlashedValidator;
use near_primitives::epoch_manager::EpochConfig;
use near_primitives::hash::hash;
use near_primitives::shard_layout::ShardLayout;
use near_primitives::sharding::{ShardChunkHeader, ShardChunkHeaderV3};
use near_primitives::stateless_validation::{
    ChunkStateTransition, ChunkStateWitness, ChunkStateWitnessInner,
};
use near_primitives::types::ValidatorKickoutReason::{NotEnoughBlocks, NotEnoughChunks};
use near_primitives::validator_signer::ValidatorSigner;
use near_primitives::version::ProtocolFeature::SimpleNightshade;
use near_primitives::version::PROTOCOL_VERSION;
use near_store::test_utils::create_test_store;
use num_rational::Ratio;

impl EpochManager {
    /// Returns
    
fn test_chunk_validator_kickout() {
    let stake_amount = 1_000_000;
    let validators =
        vec![("test1".parse().unwrap(), stake_amount), ("test2".parse().unwrap(), stake_amount)];
    let epoch_length = 10;
    let total_supply = stake_amount * validators.len() as u128;
    let mut em = setup_epoch_manager(
        validators,
        epoch_length,
        4,
        2,
        0,
        90,
        70,
        0,
        default_reward_calculator(),
    );
    let rng_seed = [0; 32];
    let hashes = hash_range((epoch_length + 2) as usize);
    record_block(&mut em, Default::default(), hashes[0], 0, vec![]);
    let mut expected = 0;
    for (prev_block, (height, curr_block)) in hashes.iter().zip(hashes.iter().enumerate().skip(1)) {
        let height = height as u64;
        let epoch_id = em.get_epoch_id_from_prev_block(prev_block).unwrap();
        let epoch_info = em.get_epoch_info(&epoch_id).unwrap().clone();
        if height < epoch_length {
            let chunk_mask = (0..4)
                .map(|shard_id| {
                    let chunk_producer = EpochManager::chunk_producer_from_info(
                        &epoch_info,
                        height,
                        shard_id as u64,
                    )
                    .unwrap();
                    // test1 skips chunks
                    if chunk_producer == 0 {
                        expected += 1;
                        false
                    } else {
                        true
                    }
                })
                .collect();
            em.record_block_info(
                block_info(
                    *curr_block,
                    height,
                    height - 1,
                    *prev_block,
                    *prev_block,
                    epoch_id.0,
                    chunk_mask,
                    total_supply,
                ),
                rng_seed,
            )
            .unwrap();
        } else {
            em.record_block_info(
                block_info(
                    *curr_block,
                    height,
                    height - 1,
                    *prev_block,
                    *prev_block,
                    epoch_id.0,
                    vec![true, true, true, true],
                    total_supply,
                ),
                rng_seed,
            )
            .unwrap();
        }
    }

    let last_epoch_info = hashes.iter().filter_map(|x| em.get_epoch_info(&EpochId(*x)).ok()).last();
    assert_eq!(
        last_epoch_info.unwrap().validator_kickout(),
        &[(
            "test1".parse().unwrap(),
            ValidatorKickoutReason::NotEnoughChunks { produced: 0, expected }
        )]
        .into_iter()
        .collect::<HashMap<_, _>>(),
    );
}