use crate::ServerError;
use crate::server::connection::process::readiness_stop_tests::{
check_stop_and_failure, logged_while,
};
#[test]
fn a_websocket_connection_the_stop_closes_logs_no_error_and_is_torn_down_as_a_failed_one()
-> Result<(), String> {
let (mut stopped, _stopped_client) = super::tests::scheduler_free_process()?;
let (mut failed, _failed_client) = super::tests::scheduler_free_process()?;
check_stop_and_failure(
logged_while(|| stopped.fail_slice(7, &ServerError::ReadinessClosedByStop { pid: 7 })),
logged_while(|| {
failed.fail_slice(
8,
&ServerError::ListenerAccept {
message:
"failed to register connection readiness: readiness poll thread has failed"
.to_owned(),
},
)
}),
);
Ok(())
}