From 89cfcce146e9d7a52b1b789b729d4e49bb5acb27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eric=20Meadows-J=C3=B6nsson?= Date: Mon, 28 Sep 2026 14:32:37 +0200 Subject: [PATCH] Close the HTTP/2 test server listen socket after accepting TestServer.listen_and_accept/0 opened a TLS listen socket that nothing closed, so every HTTP/2 fuzz scenario left a listener behind: 200 scenarios grew the tcp_inet ports from 1 to 201 and the processes from 125 to 527. The accepting task now closes the listen socket once it has accepted the single connection it serves, and the same 200 scenarios end with 1 port and 127 processes. --- test/support/mint/http2/test_server.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/test/support/mint/http2/test_server.ex b/test/support/mint/http2/test_server.ex index 41834641..d211c111 100644 --- a/test/support/mint/http2/test_server.ex +++ b/test/support/mint/http2/test_server.ex @@ -121,6 +121,7 @@ defmodule Mint.HTTP2.TestServer do Task.async(fn -> # Let's accept a new connection. {:ok, socket} = :ssl.transport_accept(listen_socket) + :ok = :ssl.close(listen_socket) if function_exported?(:ssl, :handshake, 1) do {:ok, _} = apply(:ssl, :handshake, [socket])