Skip to content

Commit 11fe11b

Browse files
committed
* Fix test that shared an IChannel among threads.
1 parent 1fe4a96 commit 11fe11b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

projects/Test/Integration/TestAsyncConsumer.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,14 @@ public async Task TestDeclarationOfManyAutoDeleteQueuesWithTransientConsumer()
600600
{
601601
tasks.Add(Task.Run(async () =>
602602
{
603-
QueueName q = GenerateQueueName();
604-
await _channel.QueueDeclareAsync(q, false, false, true);
605-
var dummy = new AsyncEventingBasicConsumer(_channel);
606-
ConsumerTag tag = await _channel.BasicConsumeAsync(q, true, dummy);
607-
await _channel.BasicCancelAsync(tag);
603+
using (IChannel ch = await _conn.CreateChannelAsync())
604+
{
605+
QueueName q = GenerateQueueName();
606+
await ch.QueueDeclareAsync(q, false, false, true);
607+
var dummy = new AsyncEventingBasicConsumer(_channel);
608+
ConsumerTag tag = await ch.BasicConsumeAsync(q, true, dummy);
609+
await ch.BasicCancelAsync(tag);
610+
}
608611
}));
609612
}
610613
await Task.WhenAll(tasks);

0 commit comments

Comments
 (0)