Skip to content

Commit

Permalink
Fix test connection retry
Browse files Browse the repository at this point in the history
  • Loading branch information
mtmk committed Jan 25, 2025
1 parent d4fa354 commit f2fd102
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/NATS.Client.Core.Tests/ClusterTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using NATS.Client.TestUtilities2;

namespace NATS.Client.Core.Tests;

public class ClusterTests(ITestOutputHelper output)
Expand Down Expand Up @@ -47,6 +49,7 @@ public async Task Seed_urls_on_retry(bool userAuthInUrl)
NoRandomize = true,
Url = $"{url1},{url2}",
});
await nats.ConnectRetryAsync();

using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(60));

Expand Down
2 changes: 2 additions & 0 deletions tests/NATS.Client.Core.Tests/TlsClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Net.Sockets;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using NATS.Client.TestUtilities2;

namespace NATS.Client.Core.Tests;

Expand Down Expand Up @@ -78,6 +79,7 @@ public async Task Client_cannot_connect_without_certificate(TransportType transp
var clientOpts = server.ClientOpts(NatsOpts.Default);
clientOpts = clientOpts with { TlsOpts = clientOpts.TlsOpts with { CertFile = null, KeyFile = null } };
await using var nats = new NatsConnection(clientOpts);
await nats.ConnectRetryAsync();

var exceptionTask = Assert.ThrowsAsync<NatsException>(async () => await nats.ConnectAsync());

Expand Down

0 comments on commit f2fd102

Please sign in to comment.