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: future.rs
    path of file: ./repos/tikv/components/tikv_util/src/mpsc
    
    the code of the file until where you have to start completion: // Copyright 2022 TiKV Project Authors. Licensed under Apache-2.0.

//! A module provides the implementation of receiver that supports async/await.

use std::{
    pin::Pin,
    sync::atomic::{self, AtomicUsize, Ordering},
    task::{Context, Poll},
    time
    
    fn test_batch_receiver() {
        let (tx, rx) = unbounded::<u64>(WakePolicy::TillReach(4));

        let len = Arc::new(AtomicUsize::new(0));
        let l = len.clone();
        let rx = BatchReceiver::new(rx, 8, || Vec::with_capacity(4), Vec::push);
        let (_pool, msg_counter) = spawn_and_wait(move || {
            stream::unfold((rx, l), |(mut rx, l)| async move {
                rx.next().await.map(|i| {
                    l.fetch_add(i.len(), Ordering::SeqCst);
                    (i, (rx, l))
                })
            })
        });

        tx.send(0).unwrap();
        thread::sleep(time::Duration::from_millis(10));
        assert_eq!(msg_counter.load(Ordering::SeqCst), 0);

        // Auto notify with more messages.
        for _ in 0..16 {
            tx.send(0).unwrap();
        }
        thread::sleep(time::Duration::from_millis(10));
        let batch_count = msg_counter.load(Ordering::SeqCst);
        assert!(batch_count < 17, "{}", batch_count);
        assert_eq!(len.load(Ordering::SeqCst), 17);
    }