docs: add XML doc comments to server types and fix flaky test timings
Add XML doc comments to public properties across EventTypes, Connz, Varz, NatsOptions, StreamConfig, IStreamStore, FileStore, MqttListener, MqttSessionStore, MessageTraceContext, and JetStreamApiResponse. Fix flaky tests by increasing timing margins (ResponseTracker expiry 1ms→50ms, sleep 50ms→200ms) and document known flaky test patterns in tests.md.
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
|
||||
using NATS.Server.JetStream.Models;
|
||||
using NATS.Server.JetStream.Storage;
|
||||
using NATS.Server.TestUtilities;
|
||||
|
||||
namespace NATS.Server.JetStream.Tests.JetStream.Storage;
|
||||
|
||||
@@ -491,7 +492,7 @@ public sealed class MemStoreGoParityTests
|
||||
s.StoreMsg("A", null, "OK"u8.ToArray(), 0);
|
||||
if (i == total / 2)
|
||||
{
|
||||
Thread.Sleep(100);
|
||||
Thread.Sleep(250);
|
||||
midTime = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
@@ -593,7 +594,7 @@ public sealed class MemStoreGoParityTests
|
||||
|
||||
// Go: TestMemStoreMessageTTL server/memstore_test.go:1202
|
||||
[Fact]
|
||||
public void MessageTTL_ExpiresAfterDelay()
|
||||
public async Task MessageTTL_ExpiresAfterDelay()
|
||||
{
|
||||
var cfg = new StreamConfig
|
||||
{
|
||||
@@ -616,8 +617,13 @@ public sealed class MemStoreGoParityTests
|
||||
ss.LastSeq.ShouldBe(10UL);
|
||||
ss.Msgs.ShouldBe(10UL);
|
||||
|
||||
// Wait for TTL to expire (> 1 sec + check interval of 1 sec)
|
||||
Thread.Sleep(2_500);
|
||||
// Wait for TTL to expire
|
||||
await PollHelper.WaitOrThrowAsync(() =>
|
||||
{
|
||||
var ss2 = new StreamState();
|
||||
s.FastState(ref ss2);
|
||||
return ss2.Msgs == 0;
|
||||
}, "TTL expiry", timeoutMs: 10_000, intervalMs: 100);
|
||||
|
||||
s.FastState(ref ss);
|
||||
ss.FirstSeq.ShouldBe(11UL);
|
||||
|
||||
Reference in New Issue
Block a user