Cut 9 Soul fixes: UTF-8 RTDP pong truncation, ServerBrowser row disposal guard, DirectoryReporter snapshot lock, and test deadline

This commit is contained in:
Meta Vens 2026-12-05 18:09:30 +01:00
commit fe1eec54a8
4 changed files with 84 additions and 36 deletions

View file

@ -196,7 +196,7 @@ namespace RustToDust.Tests
try
{
var deadline = DateTime.UtcNow.AddSeconds(3);
var deadline = DateTime.UtcNow.AddSeconds(15);
IReadOnlyList<DirectoryServerInfo> servers = Array.Empty<DirectoryServerInfo>();
while (DateTime.UtcNow < deadline)
{
@ -213,7 +213,7 @@ namespace RustToDust.Tests
phase = "Active";
reporter.NotifyChanged();
deadline = DateTime.UtcNow.AddSeconds(3);
deadline = DateTime.UtcNow.AddSeconds(15);
while (DateTime.UtcNow < deadline)
{
servers = await DirectoryBrowserClient.FetchServersAsync(baseUrl);
@ -607,5 +607,31 @@ namespace RustToDust.Tests
Assert.Equal(MatchPhase.Completed, decodedCompleted.Phase);
Assert.Equal(3, decodedCompleted.WinnerContenderId);
}
[Fact]
public async Task StatelessUdpPing_HandlesMultiByteUtf8ServerName_WithoutOverflow()
{
string multiByteName = new string('\u2022', 24);
using var host = new ServerMatchHost(
IPAddress.Loopback,
0,
seed: 77,
mapKind: ArenaMapKind.Desert,
serverName: multiByteName,
startInLobby: true);
var target = new IPEndPoint(IPAddress.Loopback, host.BoundPort);
var pingTask = ServerPingProbe.ProbeAsync(target, TimeSpan.FromSeconds(2));
while (!pingTask.IsCompleted)
{
host.PollStatelessPings();
await Task.Delay(5);
}
var res = await pingTask;
Assert.True(res.Success);
Assert.NotNull(res.Summary);
Assert.Equal(new string('\u2022', 16), res.Summary!.Value.ServerName);
}
}
}