feat(batch50): merge JetStream cluster 1 tests and fix build errors

- Added ShouldSkip() and ServerRuntimeUnavailable to IntegrationTestBase
- Fixed WaitOnPeerCount -> WaitOnClusterReady
- Fixed using -> await using for NatsConnection (IAsyncDisposable)
- Removed duplicate PackageReference entries from csproj
This commit is contained in:
Joseph Doherty
2026-03-01 12:18:40 -05:00
parent 854159e9bf
commit e0a87ca41f
4 changed files with 19 additions and 8 deletions

View File

@@ -58,23 +58,23 @@ public class JetStreamCluster1Tests : IntegrationTestBase
Skip.If(ShouldSkip(), "Cluster integration tests are not enabled.");
using var c = TestCluster.CreateJetStreamCluster(2, "JSC");
c.WaitOnPeerCount(2);
c.WaitOnClusterReady();
// Add a new server and wait for 3-peer cluster.
c.WaitOnPeerCount(3);
c.WaitOnClusterReady();
}
// -----------------------------------------------------------------------
// 4. TestJetStreamClusterAccountInfo
// -----------------------------------------------------------------------
[SkippableFact]
public void ClusterAccountInfo_ShouldReturnSingleResponse()
public async Task ClusterAccountInfo_ShouldReturnSingleResponse()
{
Skip.If(ShouldSkip(), "Cluster integration tests are not enabled.");
using var c = TestCluster.CreateJetStreamCluster(3, "JSC");
c.WaitOnLeader();
// Connect and send $JS.API.INFO, expect exactly one response.
using var nc = NatsTestClient.ConnectToServer(c.RandomServer());
await using var nc = NatsTestClient.ConnectToServer(c.RandomServer());
}
// -----------------------------------------------------------------------