test: move the last inline test modules to tests/, document new signals
- All remaining #[cfg(test)] modules left src/ (manager auth/heartbeat, protocol registry and HTTP parser, traffic hook/prefix/profile, TUI Prometheus); 41 tests moved into 10 integration suites with the same names and assertions, so `grep -rn '#[cfg(test)]' src/` is now empty. - runbook.md: degradation signals (overloaded connections, ClickHouse drops, XDP drops, generic mode, EMFILE backoff) and how to verify XDP was detached. - troubleshooting.md: accept backoff, orphaned XDP, password/JWT startup requirements, ClickHouse event loss. - TODO: review round recorded as fixed/deferred.
This commit is contained in:
parent
e456cb583f
commit
da87d2a11f
21 changed files with 600 additions and 521 deletions
23
tests/protocol_http_handler.rs
Normal file
23
tests/protocol_http_handler.rs
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
//! HTTP protocol handler: a zero `max_header_bytes` fails on the public
|
||||
//! handshake path before any socket I/O happens.
|
||||
#![cfg(feature = "protocol-http")]
|
||||
|
||||
use rampart::config::HttpProtocolConfig;
|
||||
use rampart::protocol::ProtocolHandler;
|
||||
use rampart::protocol::http::HttpProtocolHandler;
|
||||
|
||||
#[tokio::test]
|
||||
async fn zero_limit_fails_fast_without_io() {
|
||||
let config = HttpProtocolConfig::default();
|
||||
let mut broken = config.clone();
|
||||
broken.max_header_bytes = 0;
|
||||
let handler = HttpProtocolHandler::new(&broken, &[]);
|
||||
let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await.expect("bind");
|
||||
let client = tokio::net::TcpStream::connect(listener.local_addr().expect("addr"))
|
||||
.await
|
||||
.expect("connect");
|
||||
let (mut server, _) = listener.accept().await.expect("accept");
|
||||
drop(listener);
|
||||
assert!(handler.handshake(&mut server).await.is_err());
|
||||
drop(client);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue