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_suite_runner.rs
    path of file: ./repos/pulsar/test-suite/src
    
    the code of the file until where you have to start completion: use std::panic::AssertUnwindSafe;

use bpf_common::test_runner::{TestCase, TestReport, TestSuite};
use futures::FutureExt;
use libtest_mimic::{Arguments, Failed, Trial};
use tokio::sync::{mpsc, oneshot};

pub struct TestSuiteRunner {
    tx_test: mpsc::Sender<TestRequest>,
}

struct TestRequest {
    test_case: TestCase,
    tx_reply: oneshot::Sender<Result<(), Failed>>,
}

impl TestSuiteRunner {
    /// Spawn the actual test runner in a background task. This is needed to run
    /// async tests from libtest_mimic.
    pub fn spawn() -> Self {
        // Since writing to stdout will mess the output,
        // we'll write logs to a channel instead.
        let (tx_log, mut rx_log) = mpsc::unbounded_channel();
        replace_logger(tx_log.clone());
        replace_panic_hook(tx_log);
        bpf_common::bump_memlock_rlimit().unwrap();
        // Spawn the actual runner, which receives tests over a channel.
        let (tx_test, mut rx_test) = mpsc::channel::<TestRequest>(1);
        tokio::spawn(async move {
            // Start the trace_pipe eBPF program log interceptor
            #[cfg(debug_assertions)]
            let _stop_handle = tokio::spawn(bpf_common::trace_pipe::start());

            while let Some(test_request) = rx_test.recv().await {
                // Run actual test and treat eventual panics as errors.
                let TestReport { success, mut lines } =
                    AssertUnwindSafe(test_request.test_case.test)
                        .catch_unwind()
                        .await
                        .unwrap_or(TestReport {
                            success: false
    
    pub fn spawn() -> Self {
        // Since writing to stdout will mess the output,
        // we'll write logs to a channel instead.
        let (tx_log, mut rx_log) = mpsc::unbounded_channel();
        replace_logger(tx_log.clone());
        replace_panic_hook(tx_log);
        bpf_common::bump_memlock_rlimit().unwrap();
        // Spawn the actual runner, which receives tests over a channel.
        let (tx_test, mut rx_test) = mpsc::channel::<TestRequest>(1);
        tokio::spawn(async move {
            // Start the trace_pipe eBPF program log interceptor
            #[cfg(debug_assertions)]
            let _stop_handle = tokio::spawn(bpf_common::trace_pipe::start());

            while let Some(test_request) = rx_test.recv().await {
                // Run actual test and treat eventual panics as errors.
                let TestReport { success, mut lines } =
                    AssertUnwindSafe(test_request.test_case.test)
                        .catch_unwind()
                        .await
                        .unwrap_or(TestReport {
                            success: false,
                            lines: vec![],
                        });

                // Collect logs and append them to the report lines
                while let Ok(log) = rx_log.try_recv() {
                    lines.push(log);
                }

                // Display output through libtest mimic
                test_request
                    .tx_reply
                    .send(if success {
                        Ok(())
                    } else {
                        Err(lines.join("\n").into())
                    })
                    .unwrap();
            }
        });

        Self { tx_test }
    }