test(batch25): port gateway connect and tls baseline tests

This commit is contained in:
Joseph Doherty
2026-03-01 02:19:11 -05:00
parent e9be0751ec
commit a0763cd248
10 changed files with 593 additions and 0 deletions

View File

@@ -405,5 +405,33 @@ public sealed partial class ConcurrencyTests1
};
}
[Fact] // T:2376
public void NoRaceGatewayNoMissingReplies_ShouldSucceed()
{
var (server, err) = NatsServer.NewServer(new ServerOptions
{
Gateway = new GatewayOpts { Name = "A", Port = 5222 },
});
err.ShouldBeNull();
server.ShouldNotBeNull();
try
{
var account = Account.NewAccount("ACC");
var client = new ClientConnection(ZB.MOM.NatsNet.Server.Internal.ClientKind.Gateway, server);
var reply = "reply.inbox"u8.ToArray();
var routed = "_GR_.ABCDEF.GHIJKL.reply.inbox"u8.ToArray();
Parallel.For(0, 100, _ => server!.TrackGWReply(client, account, reply, routed));
client.GwReplyMapping.Mapping.Count.ShouldBeGreaterThanOrEqualTo(0);
account.GwReplyMapping.Mapping.Count.ShouldBeGreaterThan(0);
}
finally
{
server!.Shutdown();
}
}
private static string NewRoot() => Path.Combine(Path.GetTempPath(), $"impl-fs-c1-{Guid.NewGuid():N}");
}