test(https): give the TLS tests ports of their own

The new tests reused ports the existing suite already binds — 8095 with
ShouldSurviveAbuseHTTP1, and 8097/8098 with ShouldFallbackUnknownRoutes'
plaintext and HTTP/3 listeners. SO_REUSEADDR does not let two live
listeners share a port, so under the parallel runner whichever bound
second failed, and which test that was came down to scheduling. Move the
TLS tests to 8110-8114, which nothing else uses.

That collision also showed up as a SIGABRT rather than a reported error,
so harden the path it took: ~ListenerHTTP1 calls Stop(), which joins
threads and touches sockets and can therefore throw. A second listener
failing to bind unwinds past a live first one, and a throw out of its
destructor mid-unwind terminates the process — turning a diagnosable bind
failure into a crash. Swallow it there, where there is nothing left to
report it to.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
catbot 2026-07-28 20:34:23 +00:00
commit 14e0a6bab1
4 changed files with 34 additions and 23 deletions

View file

@ -288,7 +288,15 @@ ListenerHTTP1::ListenerHTTP1(ListenerHTTP1&& other) noexcept
}
ListenerHTTP1::~ListenerHTTP1() {
if (impl) Stop();
// Stop() joins threads and touches sockets, so it can throw. Letting that
// out of a destructor ends the process — and the case where it matters is
// exactly the unhappy one: a second listener failing to bind unwinds past
// a live first listener, so a throw here replaces a reportable error with
// a terminate.
try {
if (impl) Stop();
} catch (...) {
}
}
void ListenerHTTP1::Listen() {
@ -372,7 +380,10 @@ ListenerAsyncHTTP1::ListenerAsyncHTTP1(std::uint16_t port,
{}
ListenerAsyncHTTP1::~ListenerAsyncHTTP1() {
Stop();
try {
Stop();
} catch (...) {
}
}
void ListenerAsyncHTTP1::Stop() {