@@ -53,6 +53,7 @@ public abstract class IntegrationFixture : IAsyncLifetime
53
53
private static int _connectionIdx = 0 ;
54
54
55
55
private Exception _connectionCallbackException ;
56
+ private Exception _connectionRecoveryException ;
56
57
private Exception _channelCallbackException ;
57
58
58
59
protected readonly RabbitMQCtl _rabbitMQCtl ;
@@ -197,6 +198,11 @@ public virtual async Task DisposeAsync()
197
198
198
199
protected virtual void DisposeAssertions ( )
199
200
{
201
+ if ( _connectionRecoveryException != null )
202
+ {
203
+ Assert . Fail ( $ "unexpected connection recovery exception: { _connectionRecoveryException } ") ;
204
+ }
205
+
200
206
if ( _connectionCallbackException != null )
201
207
{
202
208
Assert . Fail ( $ "unexpected connection callback exception: { _connectionCallbackException } ") ;
@@ -212,6 +218,23 @@ protected void AddCallbackExceptionHandlers()
212
218
{
213
219
if ( _conn != null )
214
220
{
221
+ _conn . ConnectionRecoveryError += ( s , ea ) =>
222
+ {
223
+ _connectionRecoveryException = ea . Exception ;
224
+
225
+ if ( IsVerbose )
226
+ {
227
+ try
228
+ {
229
+ _output . WriteLine ( $ "{ 0 } connection recovery exception: { 1 } ",
230
+ _testDisplayName , _connectionRecoveryException ) ;
231
+ }
232
+ catch ( InvalidOperationException )
233
+ {
234
+ }
235
+ }
236
+ } ;
237
+
215
238
_conn . CallbackException += ( o , ea ) =>
216
239
{
217
240
_connectionCallbackException = ea . Exception ;
@@ -221,7 +244,7 @@ protected void AddCallbackExceptionHandlers()
221
244
try
222
245
{
223
246
_output . WriteLine ( "{0} connection callback exception: {1}" ,
224
- _testDisplayName , ea . Exception ) ;
247
+ _testDisplayName , _connectionCallbackException ) ;
225
248
}
226
249
catch ( InvalidOperationException )
227
250
{
@@ -241,7 +264,7 @@ protected void AddCallbackExceptionHandlers()
241
264
try
242
265
{
243
266
_output . WriteLine ( "{0} channel callback exception: {1}" ,
244
- _testDisplayName , ea . Exception ) ;
267
+ _testDisplayName , _channelCallbackException ) ;
245
268
}
246
269
catch ( InvalidOperationException )
247
270
{
0 commit comments