You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after a little investigation I realized that there's actually no need for #1390 nor shutdown APIs, as downstream connections can be easily emulated with a TcpStream::connect
for example:
#[tokio::test]asyncfntproxy_survives_downstream_disconnect(){
tracing_subscriber::fmt().with_env_filter(EnvFilter::from_default_env()).init();let(_tp, tp_addr) = start_template_provider(None).await;let(_pool, pool_addr) = start_pool(Some(tp_addr)).await;let(_, tproxy_addr) = start_sv2_translator(pool_addr).await;// emulate first downstreamlet downstream_a = std::net::TcpStream::connect(tproxy_addr).unwrap();// emulate second downstreamlet _downstream_b = std::net::TcpStream::connect(tproxy_addr).unwrap();// wait a bit to make sure the TCP sockets are processed
tokio::time::sleep(std::time::Duration::from_secs(1)).await;// kill downstream_a
downstream_a.shutdown(std::net::Shutdown::Both).unwrap();drop(downstream_a);// wait a bit to make sure the TCP sockets are processed
tokio::time::sleep(std::time::Duration::from_secs(1)).await;// tproxy still upassert!(tokio::net::TcpListener::bind(tproxy_addr).await.is_err());}
plebhash
changed the title
Integration Test for disconnecting downstream connections on all roles
need Integration Test for disconnecting downstream connections on all roles
Feb 1, 2025
#1426 made us notice an edge case that ideally we should cover in CI for all roles that accept downstream connections.
the tests should look something like this:
the test should assert that the role stays alive (and doesn't die like in #1426)
The text was updated successfully, but these errors were encountered: