Skip to content

Commit 27771e4

Browse files
committed
Fix failing test
Give broker time to clean up the resources
1 parent 85ed90e commit 27771e4

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

test/ActiveMQ.Artemis.Client.IntegrationTests/AddressModelSpec.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ await topologyManager.CreateQueueAsync(new QueueConfiguration
132132
await queue2Consumer1.DisposeAsync();
133133
await queue2Consumer2.DisposeAsync();
134134

135+
// give broker time to clean up the resources
136+
await Task.Delay(100);
137+
135138
await using var newQueue1Consumer1 = await connection2.CreateConsumerAsync(address, queue1);
136139
await using var newQueue1Consumer2 = await connection2.CreateConsumerAsync(address, queue1);
137140
await using var newQueue2Consumer1 = await connection2.CreateConsumerAsync(address, queue2);

test/ActiveMQ.Artemis.Client.UnitTests/AutoRecovering/AutoRecoveringConsumerSpec.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ public async Task Should_be_able_to_receive_messages_when_connection_restored()
3838
[Fact]
3939
public async Task Should_be_able_to_receive_message_when_connection_restored_after_receive_called()
4040
{
41-
var endpoint = GetUniqueEndpoint();
42-
var host1 = CreateOpenedContainerHost(endpoint);
41+
var host1 = CreateOpenedContainerHost();
42+
var host2 = CreateContainerHost();
4343

44-
var connection = await CreateConnection(endpoint);
44+
var connection = await CreateConnection(new[] { host1.Endpoint, host2.Endpoint });
4545
var consumer = await connection.CreateConsumerAsync("a1", RoutingType.Anycast);
4646

4747
var cts = new CancellationTokenSource(Timeout);
4848
var receiveTask = consumer.ReceiveAsync(cts.Token);
4949

50+
host2.Open();
5051
host1.Dispose();
5152

52-
var host2 = CreateOpenedContainerHost(endpoint);
5353
var messageSource = host2.CreateMessageSource("a1");
5454
messageSource.Enqueue(new Message("foo"));
5555

0 commit comments

Comments
 (0)