feat(batch24): complete leaf nodes implementation and verification

This commit is contained in:
Joseph Doherty
2026-03-01 01:31:57 -05:00
parent ff7e674ec4
commit 3e9ad16033
36 changed files with 3427 additions and 21 deletions

View File

@@ -204,4 +204,31 @@ public sealed partial class RouteHandlerTests
public Task<string[]> LookupHostAsync(string host, CancellationToken ct = default)
=> Task.FromResult(hosts);
}
[Fact] // T:2825
public void ClusterQueueGroupWeightTrackingLeak_ShouldSucceed()
{
var account = Account.NewAccount("$G");
var queueSub = new Subscription
{
Subject = "foo"u8.ToArray(),
Queue = "bar"u8.ToArray(),
Qw = 1,
};
account.UpdateLeafNodes(queueSub, 1);
var lqwsField = typeof(Account).GetField("_lqws", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
lqwsField.ShouldNotBeNull();
var lqws = (Dictionary<string, int>?)lqwsField!.GetValue(account);
lqws.ShouldNotBeNull();
lqws!.TryGetValue("foo bar", out var initialWeight).ShouldBeTrue();
initialWeight.ShouldBe(1);
account.UpdateLeafNodes(queueSub, -1);
lqws = (Dictionary<string, int>?)lqwsField.GetValue(account);
(lqws?.ContainsKey("foo bar") ?? false).ShouldBeFalse();
}
}