Relay: two unflushed TLS writes remain, and the flush test is weak (follow-ups from #1470)
From the review of #1470:
- F-1: without the fix, the new test fails only about 1 run in 8. A test of
direct::copyovertokio::io::duplex(4096)would fail every time. - F-2: two TLS writes outside that diff still skip the flush. One is the ClientHello write into the Mac's data connection. The other is the registry POST to the DNS helper, which batches up to 5,000 updates, so a large batch can stall until the 10 s POST_TIMEOUT.
Hey, I'll take these. F-1: the #1470 test goes through loopback TCP so the kernel buffers usually swallow everything; over tokio::io::duplex(4096) tokio-rustls accepts a 16 KB write with part of the record still unsent, so a missing flush fails every run instead of 1 in 8. Plan is a small test_tls pair over that pipe and tests for direct::copy and the client copy loop with it. F-2: client::run writes the ClientHello into the data connection with write_all and no flush, and registry::post goes from write_all straight to read_to_end, so a big batch can sit until POST_TIMEOUT. Flushing both (a send_hello and a shared exchange()), each with a test over the same 4 KB pipe that fails without the flush.
PR's up: #1498. Both writes flush now, and the tests run over a 4 KB in-memory pipe so they fail every run without the flush instead of 1 in 8.