Skip to content

Commit

Permalink
Make ServiceBus tests more stable
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-pajurek committed Oct 15, 2024
1 parent 3efe816 commit 6a94a6b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/Tests/ServiceBus/ServiceBusSessionsReceiverTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,15 @@ public async Task Accepting_Specific_Empty_Session_Should_Not_Fail_And_Subsequen

await using var sessionReceiver = await client.AcceptSessionAsync(queueName, sessionId);

var messagesBeforeSend = await sessionReceiver.ReceiveMessagesAsync(100, maxWaitTime: TimeSpan.FromMilliseconds(100));
var messagesBeforeSend = await sessionReceiver.ReceiveMessagesAsync(1, maxWaitTime: TimeSpan.FromSeconds(10));

messagesBeforeSend.Should().BeEmpty();

await using var sender = client.CreateSender(queueName);

await sender.SendMessageAsync(new ServiceBusMessage(BinaryData.FromString("Hello, world!")) { SessionId = sessionId });

var messagesAfterSend = await sessionReceiver.ReceiveMessagesAsync(100, maxWaitTime: TimeSpan.FromMilliseconds(100));
var messagesAfterSend = await sessionReceiver.ReceiveMessagesAsync(1, maxWaitTime: TimeSpan.FromSeconds(10));

messagesAfterSend.Should().HaveCount(1);
messagesAfterSend[0].Body.ToString().Should().Be("Hello, world!");
Expand Down

0 comments on commit 6a94a6b

Please sign in to comment.