fix(backend): harden office-disabled cron, title limits, and dead-runtime cleanup (#2206)

This commit is contained in:
Carlos Florêncio
2026-08-03 15:11:58 +01:00
committed by GitHub
parent d9ea08af82
commit 3f46da6645
45 changed files with 1869 additions and 84 deletions
@@ -52,6 +52,21 @@ func freePort(t *testing.T) int {
return port
}
// requireLoopbackAlias skips the test when host cannot be bound. Linux treats
// all of 127.0.0.0/8 as loopback, but macOS only configures 127.0.0.1 by
// default, so multi-loopback binding tests are unrunnable there without an
// explicit lo0 alias.
func requireLoopbackAlias(t *testing.T, host string) {
t.Helper()
ln, err := net.Listen("tcp", net.JoinHostPort(host, "0"))
if err != nil {
t.Skipf("loopback alias %s not available on this host: %v", host, err)
}
if err := ln.Close(); err != nil {
t.Fatalf("close loopback probe listener: %v", err)
}
}
func noContentServer() *http.Server {
return &http.Server{
Handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
@@ -109,6 +124,7 @@ func shutdown(t *testing.T, listeners *serverListeners, server *http.Server) {
}
func TestStartHTTPServersMultipleLoopbackAddresses(t *testing.T) {
requireLoopbackAlias(t, "127.0.0.2")
log := testLogger(t)
port := freePort(t)
server := noContentServer()
@@ -152,6 +168,7 @@ func TestStartHTTPServersAllFailIsFatal(t *testing.T) {
}
func TestStartHTTPServersPartialFailSelfHeals(t *testing.T) {
requireLoopbackAlias(t, "127.0.0.2")
defer goleak.VerifyNone(t)
// Shorten the retry cadence for the test and restore it after.