Compare commits

..
Author SHA1 Message Date
beardthelion eaec6113e8 Merge origin/main into fix/reconciliation-sweep-flakes 2026-11-13 18:39:44 -06:00
beardthelion ceef11062e test(node): close the fake S3 connection after each response
The fake serves one request per socket and drops it, but its responses
carried no Connection: close, so the client kept the dead socket in its
pool. With retries disabled (as in production) a reused dead connection
failed the restore, and sweep_restores_tigris_cache_miss_and_skips_missing
skipped its repo with 'repo acquire failed' on a loaded runner.
2026-11-13 17:37:22 -06:00
+8 -1
View File
@@ -6440,6 +6440,13 @@ mod tests {
/// Write one canned HTTP response on an accepted fake-S3 socket.
/// A free function (not a closure) so the `&mut` socket borrow does
/// not leak into a returned future's lifetime.
///
/// The fake serves one request per accepted socket and drops it, so each
/// response says `Connection: close`. Without it the client keeps the
/// socket in its pool after the server has closed it, and the next request
/// can reuse a dead connection. The client has retries disabled, as in
/// production, so `sweep_restores_tigris_cache_miss_and_skips_missing`
/// failed with "repo acquire failed" on a loaded runner.
async fn s3_respond(
sock: &mut tokio::net::TcpStream,
status: &str,
@@ -6448,7 +6455,7 @@ mod tests {
) {
use tokio::io::AsyncWriteExt;
let head = format!(
"HTTP/1.1 {status}\r\nContent-Length: {}\r\n{extra}\r\n",
"HTTP/1.1 {status}\r\nContent-Length: {}\r\nConnection: close\r\n{extra}\r\n",
payload.len()
);
let _ = sock.write_all(head.as_bytes()).await;