Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flaky test ReceiveLotOfMessagesWithoutSettling in Microsoft.Azure.ServiceBus #19454

Merged
merged 10 commits into from
Jun 10, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Microsoft.Azure.ServiceBus.UnitTests
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -102,7 +103,7 @@ await ServiceBusScope.UsingQueueAsync(partitioned, sessionEnabled, async queueNa
var queueClient = new QueueClient(TestUtility.NamespaceConnectionString, queueName, ReceiveMode.ReceiveAndDelete);
try
{
await this.ReceiveDeleteTestCase(queueClient.InnerSender, queueClient.InnerReceiver, messageCount);
await this.ReceiveDeleteTestCase(queueClient.InnerSender, queueClient.InnerReceiver, messageCount, TimeSpan.FromSeconds(10));
}
finally
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ internal async Task PeekLockTestCase(IMessageSender messageSender, IMessageRecei
await TestUtility.CompleteMessagesAsync(messageReceiver, receivedMessages);
}

internal async Task ReceiveDeleteTestCase(IMessageSender messageSender, IMessageReceiver messageReceiver, int messageCount)
internal async Task ReceiveDeleteTestCase(IMessageSender messageSender, IMessageReceiver messageReceiver, int messageCount, TimeSpan timeout)
{
await TestUtility.SendMessagesAsync(messageSender, messageCount);
var receivedMessages = await TestUtility.ReceiveMessagesAsync(messageReceiver, messageCount, TimeSpan.FromSeconds(10));
var receivedMessages = await TestUtility.ReceiveMessagesAsync(messageReceiver, messageCount, timeout);
Assert.Equal(messageCount, receivedMessages.Count);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ await ServiceBusScope.UsingQueueAsync(partitioned, sessionEnabled, async queueNa
});
}

[Fact(Skip="Flaky test. Tracked by #16265")]
[Fact]
[LiveTest]
[DisplayTestMethodName]
public async Task ReceiveLotOfMessagesWithoutSettling()
Expand All @@ -59,7 +59,7 @@ await ServiceBusScope.UsingQueueAsync(false, false, async queueName =>

try
{
await this.ReceiveDeleteTestCase(sender, receiver, messageCount);
await this.ReceiveDeleteTestCase(sender, receiver, messageCount, TimeSpan.FromMinutes(2));
}
finally
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

namespace Microsoft.Azure.ServiceBus.UnitTests
{
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xunit;
Expand Down Expand Up @@ -65,7 +66,8 @@ await ServiceBusScope.UsingTopicAsync(partitioned, sessionEnabled, async (topicN
this.ReceiveDeleteTestCase(
topicClient.InnerSender,
subscriptionClient.InnerSubscriptionClient.InnerReceiver,
messageCount);
messageCount,
TimeSpan.FromSeconds(10));
}
finally
{
Expand Down