Skip to content

Commit 7e8a1e9

Browse files
committed
* TestDisposedWithSocketClosedOutOfBand improvements
1 parent 1a748f4 commit 7e8a1e9

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

projects/Test/Integration/TestAsyncConsumer.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ public async Task TestBasicRoundtripConcurrentManyMessages()
186186
{
187187
await publishChannel.ConfirmSelectAsync();
188188

189-
QueueDeclareOk pubQ = await publishChannel.QueueDeclareAsync(queue: queueName, exclusive: false, durable: true);
190-
Assert.Equal(queueName, pubQ.QueueName);
191-
192189
for (int i = 0; i < publish_total; i++)
193190
{
194191
await publishChannel.BasicPublishAsync(string.Empty, queueName, body1);

projects/Test/Integration/TestConnectionShutdown.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,20 @@ public async Task TestDisposedWithSocketClosedOutOfBand()
100100
};
101101

102102
var c = (AutorecoveringConnection)_conn;
103-
await c.CloseFrameHandlerAsync();
103+
Task frameHandlerCloseTask = c.CloseFrameHandlerAsync();
104104

105-
_conn.Dispose();
106-
_conn = null;
105+
try
106+
{
107+
_conn.Dispose();
108+
await WaitAsync(tcs, WaitSpan, "channel shutdown");
109+
await frameHandlerCloseTask.WaitAsync(WaitSpan);
110+
}
111+
finally
112+
{
113+
_conn = null;
114+
_channel = null;
115+
}
107116

108-
TimeSpan waitSpan = TimeSpan.FromSeconds(10);
109-
await WaitAsync(tcs, waitSpan, "channel shutdown");
110117
}
111118

112119
[Fact]

0 commit comments

Comments
 (0)