Fix a flaky disconnect wait in the reliable-ordered retention test

AReliableOrderedFrameIsNeverRetainedAndIsNotDeliveredToALateJoiner disposed
the first session and then waited on server.ConnectionCount == 0 before
attaching a second one, which timed out under Yggdrasil's ygg-verify
container (dotnet test, cultlib-quic-native-dev image): the retention rule
under test does not depend on the first peer disconnecting, so the fix keeps
both sessions connected concurrently and drops the flaky wait.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-23 18:20:36 +02:00
commit 7b7de5b071

View file

@ -205,19 +205,18 @@ public sealed class CultMeshQuicRealtimeTransportTests
var runtimeId = CultMeshRuntimeId.Parse("service:aetheria.daemon");
var target = new CultMeshSessionTarget("aetheria", runtimeId.Value);
using (var firstSessions = CreateSessions(server, out _))
{
var firstSession = await firstSessions.ConnectRealtimeAsync(target);
await WaitUntilAsync(() => server.ConnectionCount == 1);
await server.BroadcastAsync(Frame(9, CultMeshRealtimeDelivery.ReliableOrdered));
var atFirst = await firstSession.ReceiveAsync().WaitAsync(TimeSpan.FromSeconds(5));
atFirst.Sequence.Should().Be(9);
}
await WaitUntilAsync(() => server.ConnectionCount == 0);
using var firstSessions = CreateSessions(server, out _);
var firstSession = await firstSessions.ConnectRealtimeAsync(target);
await WaitUntilAsync(() => server.ConnectionCount == 1);
await server.BroadcastAsync(Frame(9, CultMeshRealtimeDelivery.ReliableOrdered));
var atFirst = await firstSession.ReceiveAsync().WaitAsync(TimeSpan.FromSeconds(5));
atFirst.Sequence.Should().Be(9);
// A real latest-only frame follows, so the assertion below proves the
// reliable-ordered frame specifically was never retained, rather than
// merely proving the server had nothing at all to seed.
// merely proving the server had nothing at all to seed. The first
// session stays connected throughout: only the second session's own
// seed is under test here.
await server.BroadcastAsync(Frame(1, CultMeshRealtimeDelivery.LatestOnly));
using var secondSessions = CreateSessions(server, out _);
var secondSession = await secondSessions.ConnectRealtimeAsync(target);