a73x

Flaky: TestUDPSessionIsPromotedOnlyByAGuestReply races the promotion

open   by a73x

Labels: backlog

[claude 2026-08-19] Seen once in `make ci` on branch docs-user-facing (docs-only diff), green on the immediately preceding and following full runs, and 3/3 green with `-run TestUDPSessionIsPromotedOnlyByAGuestReply -count=3`.

internal/agent/exposeproxy/udp_test.go:194-195

    assert.True(t, promoted.replied.Load())
    assert.WithinDuration(t, time.Now().Add(m.repliedIdle), promoted.expiry(), time.Second)

Both failed together: replied was false, and the expiry was short by exactly 1m30s — the gap between unrepliedIdle and repliedIdle. So the session had not been promoted yet.

The test drives `say(t, talking, "hi")` and asserts on the manager's session as soon as the client has the echo. The client receiving the reply and the proxy's read path recording `replied` are two different goroutines, so under load the assertion can run first. Nothing is wrong with the proxy; the test reads state it has not waited for.

Fix shape: wait for the promotion the way the test already waits for sessions (`waitSessions`), e.g. a `waitReplied(t, m, "e2")` polling helper, rather than asserting straight after `say`.