async fn stop_component_successful_component_already_gone() {
        let stop_timeout = zx::Duration::from_millis(100);
        let (client, server) =
            endpoints::create_endpoints::<fcrunner::ComponentControllerMarker>().unwrap();

        let timer = Box::pin(fasync::Timer::new(fasync::Time::after(stop_timeout)));
        let client_proxy = client.into_proxy().expect("failed to convert client to proxy");

        // Drop the server end so it closes
        drop(server);
        match stop_component_internal(&client_proxy, timer).await {
            Ok(StopComponentSuccess::AlreadyStopped) => {}
            Ok(result) => {
                panic!("unexpected successful stop result {:?}", result);
            }
            Err(e) => {
                panic!("unexpected error stopping component {:?}", e);
            }
        }
    }
/// Test where the control channel is already closed when we try to stop
/// the component.
Test where the control channel is already closed when we try to stop
the component.
Test where the control channel is already closed when we try to stop the component .
async fn stop_component_successful_component_already_gone() {
        let stop_timeout = zx::Duration::from_millis(100);
        let (client, server) =
            endpoints::create_endpoints::<fcrunner::ComponentControllerMarker>().unwrap();
        let timer = Box::pin(fasync::Timer::new(fasync::Time::after(stop_timeout)));
        let client_proxy = client.into_proxy().expect("failed to convert client to proxy");
        // Drop the server end so it closes
        drop(server);
        match stop_component_internal(&client_proxy, timer).await {
            Ok(StopComponentSuccess::AlreadyStopped) => {}
            Ok(result) => {
                panic!("unexpected successful stop result {:?}", result);
            }
            Err(e) => {
                panic!("unexpected error stopping component {:?}", e);
            }
        }
    }
async fn stop_component_successful_component_already_gone ( ) { let stop_timeout = zx :: Duration :: from_millis ( 100 ) ; let ( client , server ) = endpoints :: create_endpoints :: < fcrunner :: ComponentControllerMarker > ( ) . unwrap ( ) ; let timer = Box :: pin ( fasync :: Timer :: new ( fasync :: Time :: after ( stop_timeout ) ) ) ; let client_proxy = client . into_proxy ( ) . expect ( " " ) ; // Drop the server end so it closes drop ( server ) ; match stop_component_internal ( & client_proxy , timer ) . await { Ok ( StopComponentSuccess :: AlreadyStopped ) => { } Ok ( result ) => { panic ! ( " " result ) ; } Err ( e ) => { panic ! ( " " e ) ; } } }
Test where the control channel is already closed when we try to stop
the component.
Test where the control channel is already closed when we try to stop the component .