Skip to content

Commit 7966dcb

Browse files
committed
Fix flaky TestConsumerRecoveryOnClientNamedQueueWithOneRecovery test.
This patch moves the long running tests to the `SequentialIntegration` project. The flakes are due to the time it takes to list connections when the `TestHundredsOfConnectionsWithRandomHeartbeatInterval` test is running.
1 parent 8cb3f39 commit 7966dcb

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

projects/Test/Integration/SslEnv.cs renamed to projects/Test/Common/SslEnv.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
using System;
3333
using System.IO;
3434

35-
namespace Test.Integration
35+
namespace Test
3636
{
3737
public class SslEnv
3838
{

projects/Test/Integration/TestConnectionRecoveryWithoutSetup.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ public async Task TestConsumerWorkServiceRecovery()
150150
public async Task TestConsumerRecoveryOnClientNamedQueueWithOneRecovery()
151151
{
152152
const string q0 = "dotnet-client.recovery.queue1";
153+
// connection #1
153154
using (AutorecoveringConnection c = await CreateAutorecoveringConnectionAsync())
154155
{
155156
using (IChannel ch = await c.CreateChannelAsync())
@@ -162,17 +163,19 @@ public async Task TestConsumerRecoveryOnClientNamedQueueWithOneRecovery()
162163
await AssertConsumerCountAsync(ch, q1, 1);
163164

164165
bool queueNameChangeAfterRecoveryCalled = false;
165-
166166
c.QueueNameChangedAfterRecovery += (source, ea) => { queueNameChangeAfterRecoveryCalled = true; };
167167

168+
// connection #2
168169
await CloseAndWaitForRecoveryAsync(c);
169170
await AssertConsumerCountAsync(ch, q1, 1);
170171
Assert.False(queueNameChangeAfterRecoveryCalled);
171172

173+
// connection #3
172174
await CloseAndWaitForRecoveryAsync(c);
173175
await AssertConsumerCountAsync(ch, q1, 1);
174176
Assert.False(queueNameChangeAfterRecoveryCalled);
175177

178+
// connection #4
176179
await CloseAndWaitForRecoveryAsync(c);
177180
await AssertConsumerCountAsync(ch, q1, 1);
178181
Assert.False(queueNameChangeAfterRecoveryCalled);

projects/Test/SequentialIntegration/SequentialIntegration.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="all" />
4343
<PackageReference Include="xunit" Version="2.7.0" />
4444
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" PrivateAssets="all" />
45+
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
4546
</ItemGroup>
4647

4748
</Project>

projects/Test/Integration/TestHeartbeats.cs renamed to projects/Test/SequentialIntegration/TestHeartbeats.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
using Xunit;
3737
using Xunit.Abstractions;
3838

39-
namespace Test.Integration
39+
namespace Test.SequentialIntegration
4040
{
41-
public class TestHeartbeats : IntegrationFixture
41+
public class TestHeartbeats : SequentialIntegrationFixture
4242
{
4343
private readonly TimeSpan _heartbeatTimeout = TimeSpan.FromSeconds(2);
4444

0 commit comments

Comments
 (0)