test: defer uv_clos'ing tcp_shutdown_after_write's socket until server performs uv_shutdown (#5060)

Fixes ASSERT thrown in tcp4_echo_server during test.
This commit is contained in:
Poul T. Lomholt 2026-03-12 23:26:15 -07:00
parent d2a45ce364
commit 6a03f2d94f

View File

@ -74,6 +74,8 @@ static void timer_cb(uv_timer_t* handle) {
static void read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) {
if (nread == UV_EOF)
uv_close((uv_handle_t*)&conn, close_cb);
}
@ -97,7 +99,6 @@ static void write_cb(uv_write_t* req, int status) {
static void shutdown_cb(uv_shutdown_t* req, int status) {
ASSERT_OK(status);
shutdown_cb_called++;
uv_close((uv_handle_t*)&conn, close_cb);
}