Skip to content

Commit

Permalink
Test flapper fixes (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtmk authored Dec 1, 2023
1 parent d08190d commit a14aa05
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/NATS.Client.JetStream.Tests/ErrorHandlerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,13 @@ public async Task Exception_propagation_handling()

var stream = await js.CreateStreamAsync(new StreamConfig("s1", new[] { "s1.*" }), cts.Token);

// reduce heartbeat time out to increase the chance of receiving notification.
var opts = new NatsJSConsumeOpts
{
MaxMsgs = 10,
NotificationHandler = (_, _) => throw new TestConsumerNotificationException(),
Expires = TimeSpan.FromSeconds(6),
IdleHeartbeat = TimeSpan.FromSeconds(3),
IdleHeartbeat = TimeSpan.FromSeconds(1),
};

// Swallow heartbeats
Expand All @@ -331,7 +332,7 @@ public async Task Exception_propagation_handling()
{
}

throw new Exception("Should have thrown");
throw new Exception("Should have thrown (consumer)");
}
catch (TestConsumerNotificationException)
{
Expand All @@ -344,7 +345,7 @@ public async Task Exception_propagation_handling()
{
}

throw new Exception("Should have thrown");
throw new Exception("Should have thrown (ordered consumer)");
}
catch (TestConsumerNotificationException)
{
Expand Down

0 comments on commit a14aa05

Please sign in to comment.