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:
@@ -1,5 +1,6 @@
|
||||
using NATS.Server;
|
||||
using NATS.Server.Raft;
|
||||
using NATS.Server.TestUtilities;
|
||||
|
||||
namespace NATS.Server.Raft.Tests.Raft;
|
||||
|
||||
@@ -226,7 +227,6 @@ public class RaftElectionTimerTests : IDisposable
|
||||
}
|
||||
|
||||
[Fact]
|
||||
[SlopwatchSuppress("SW004", "Testing timer fires after heartbeats stop requires real delays for heartbeat simulation and timeout expiry")]
|
||||
public async Task Timer_fires_after_heartbeats_stop()
|
||||
{
|
||||
var nodes = CreateTrackedCluster(3);
|
||||
@@ -246,7 +246,7 @@ public class RaftElectionTimerTests : IDisposable
|
||||
node.Role.ShouldBe(RaftRole.Follower);
|
||||
|
||||
// Stop sending heartbeats and wait for timer to fire
|
||||
await Task.Delay(200);
|
||||
await PollHelper.WaitOrThrowAsync(() => node.Role == RaftRole.Candidate, "election timeout", timeoutMs: 5000);
|
||||
|
||||
// Should have started an election
|
||||
node.Role.ShouldBe(RaftRole.Candidate);
|
||||
|
||||
Reference in New Issue
Block a user