Skip to content

Commit a650c2f

Browse files
committed
* Enable confirms in PublishMessagesWhileClosingConnAsync
1 parent 9a86e3c commit a650c2f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

projects/Test/Common/TestConnectionRecoveryBase.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,8 @@ protected async Task PublishMessagesWhileClosingConnAsync(string queueName)
202202
{
203203
using (IChannel publishingChannel = await publishingConn.CreateChannelAsync())
204204
{
205+
await publishingChannel.ConfirmSelectAsync();
206+
205207
for (ushort i = 0; i < TotalMessageCount; i++)
206208
{
207209
if (i == CloseAtCount)
@@ -210,6 +212,7 @@ protected async Task PublishMessagesWhileClosingConnAsync(string queueName)
210212
}
211213

212214
await publishingChannel.BasicPublishAsync(string.Empty, queueName, _messageBody);
215+
await publishingChannel.WaitForConfirmsOrDieAsync();
213216
}
214217

215218
await publishingChannel.CloseAsync();

projects/Test/Integration/TestConnectionShutdown.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,14 @@ public async Task TestDisposedWithSocketClosedOutOfBand()
105105
_conn.Dispose();
106106
_conn = null;
107107

108-
await WaitAsync(tcs, TimeSpan.FromSeconds(10), "channel shutdown");
108+
try
109+
{
110+
await WaitAsync(tcs, TimeSpan.FromSeconds(10), "channel shutdown");
111+
}
112+
finally
113+
{
114+
_channel = null;
115+
}
109116
}
110117

111118
[Fact]

0 commit comments

Comments
 (0)