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_error_propagation.rs
    path of file: ./repos/actix-web/actix-web/tests
    
    the code of the file until where you have to start completion: use std::sync::Arc;

use actix_utils::future::{ok, Ready};
use actix_web::{
    dev::{forward_ready, Service, ServiceRequest, ServiceResponse, Transform},
    
    
async fn error_cause_should_be_propagated_to_middlewares() {
    let lock = Arc::new(Mutex::new(None));
    let spy_middleware = SpyMiddleware(lock.clone());

    let app = init_service(
        actix_web::App::new()
            .wrap(spy_middleware.clone())
            .service(test),
    )
    .await;

    call_service(&app, TestRequest::with_uri("/test").to_request()).await;

    let was_error_captured = lock.lock().await.unwrap();
    assert!(was_error_captured);
}