From dbced1cbdb0f6a59b2cf79b7d001a9dd70de4d87 Mon Sep 17 00:00:00 2001 From: Luke Bakken Date: Fri, 25 Feb 2022 10:45:14 -0800 Subject: [PATCH] Manually port 39a9f2bdca8352ce3ecb9cee8b1ef6af6976f65f to 6.x Ports commit 39a9f2bdca8352ce3ecb9cee8b1ef6af6976f65f to 6.x branch See also: Port more of rabbitmq/rabbitmq-dotnet-client#1164 to this PR --- .../client/api/IAutorecoveringConnection.cs | 4 -- .../client/impl/AutorecoveringConnection.cs | 8 +++ .../RabbitMQ.Client/client/impl/Connection.cs | 37 +++++++--- .../client/impl/SocketFrameHandler.cs | 6 +- projects/Unit/Fixtures.cs | 23 ++++--- projects/Unit/TestAsyncConsumerExceptions.cs | 4 ++ projects/Unit/TestBasicGet.cs | 4 ++ projects/Unit/TestBasicPublishBatch.cs | 6 +- ...estConcurrentAccessWithSharedConnection.cs | 5 +- projects/Unit/TestConfirmSelect.cs | 6 +- projects/Unit/TestConnectionBlocked.cs | 5 +- ...estConnectionFactoryContinuationTimeout.cs | 6 +- projects/Unit/TestConnectionRecovery.cs | 22 +++--- projects/Unit/TestConnectionShutdown.cs | 69 +++++++++++++++++++ projects/Unit/TestConsumerCount.cs | 7 +- projects/Unit/TestConsumerExceptions.cs | 4 ++ .../Unit/TestConsumerOperationDispatch.cs | 6 +- projects/Unit/TestEventingConsumer.cs | 6 +- projects/Unit/TestExceptionMessages.cs | 4 ++ projects/Unit/TestExchangeDeclare.cs | 6 +- projects/Unit/TestExtensions.cs | 4 ++ projects/Unit/TestHeartbeats.cs | 6 +- projects/Unit/TestInitialConnection.cs | 4 ++ projects/Unit/TestInvalidAck.cs | 6 +- projects/Unit/TestMainLoop.cs | 6 +- projects/Unit/TestMessageCount.cs | 7 +- projects/Unit/TestModelShutdown.cs | 6 +- projects/Unit/TestNowait.cs | 7 +- projects/Unit/TestPassiveDeclare.cs | 4 ++ projects/Unit/TestPublishValidation.cs | 3 + projects/Unit/TestPublisherConfirms.cs | 4 ++ projects/Unit/TestQueueDeclare.cs | 6 +- projects/Unit/TestSsl.cs | 2 +- 33 files changed, 252 insertions(+), 51 deletions(-) diff --git a/projects/RabbitMQ.Client/client/api/IAutorecoveringConnection.cs b/projects/RabbitMQ.Client/client/api/IAutorecoveringConnection.cs index 6b8ed65b18..be4cb04877 100644 --- a/projects/RabbitMQ.Client/client/api/IAutorecoveringConnection.cs +++ b/projects/RabbitMQ.Client/client/api/IAutorecoveringConnection.cs @@ -30,12 +30,8 @@ //--------------------------------------------------------------------------- using System; -using System.Collections.Generic; -using System.IO; -using System.Threading; using RabbitMQ.Client.Events; -using RabbitMQ.Client.Exceptions; namespace RabbitMQ.Client { diff --git a/projects/RabbitMQ.Client/client/impl/AutorecoveringConnection.cs b/projects/RabbitMQ.Client/client/impl/AutorecoveringConnection.cs index 98af92ca2a..43b7d4fd4f 100644 --- a/projects/RabbitMQ.Client/client/impl/AutorecoveringConnection.cs +++ b/projects/RabbitMQ.Client/client/impl/AutorecoveringConnection.cs @@ -668,6 +668,14 @@ public void Init(IEndpointResolver endpoints) Init(fh); } + internal IFrameHandler FrameHandler + { + get + { + return _delegate.FrameHandler; + } + } + private void Init(IFrameHandler fh) { if (_disposed) diff --git a/projects/RabbitMQ.Client/client/impl/Connection.cs b/projects/RabbitMQ.Client/client/impl/Connection.cs index 9a1dc55da6..f6dc143f68 100644 --- a/projects/RabbitMQ.Client/client/impl/Connection.cs +++ b/projects/RabbitMQ.Client/client/impl/Connection.cs @@ -271,7 +271,7 @@ public void Abort(ushort reasonCode, string reasonText, ShutdownInitiator initia public void Close(ShutdownEventArgs reason) { - Close(reason, false, Timeout.InfiniteTimeSpan); + Close(reason, false, TimeSpan.FromSeconds(30)); } ///Try to close connection in a graceful way @@ -286,7 +286,7 @@ public void Close(ShutdownEventArgs reason) /// /// ///Timeout determines how much time internal close operations should be given - ///to complete. System.Threading.Timeout.InfiniteTimeSpan value means infinity. + ///to complete. /// /// public void Close(ShutdownEventArgs reason, bool abort, TimeSpan timeout) @@ -307,7 +307,10 @@ public void Close(ShutdownEventArgs reason, bool abort, TimeSpan timeout) { // Try to send connection.close // Wait for CloseOk in the MainLoop - _session0.Transmit(ConnectionCloseWrapper(reason.ReplyCode, reason.ReplyText)); + if (!_closed) + { + _session0.Transmit(ConnectionCloseWrapper(reason.ReplyCode, reason.ReplyText)); + } } catch (AlreadyClosedException) { @@ -453,9 +456,12 @@ public bool HardProtocolExceptionHandler(HardProtocolException hpe) _session0.SetSessionClosing(false); try { - _session0.Transmit(ConnectionCloseWrapper( - hpe.ShutdownReason.ReplyCode, - hpe.ShutdownReason.ReplyText)); + if (!_closed) + { + _session0.Transmit(ConnectionCloseWrapper( + hpe.ShutdownReason.ReplyCode, + hpe.ShutdownReason.ReplyText)); + } return true; } catch (IOException ioe) @@ -952,13 +958,13 @@ public void UpdateSecret(string newSecret, string reason) ///API-side invocation of connection abort. public void Abort() { - Abort(Timeout.InfiniteTimeSpan); + Abort(TimeSpan.FromSeconds(5)); } ///API-side invocation of connection abort. public void Abort(ushort reasonCode, string reasonText) { - Abort(reasonCode, reasonText, Timeout.InfiniteTimeSpan); + Abort(reasonCode, reasonText, TimeSpan.FromSeconds(5)); } ///API-side invocation of connection abort with timeout. @@ -976,13 +982,13 @@ public void Abort(ushort reasonCode, string reasonText, TimeSpan timeout) ///API-side invocation of connection.close. public void Close() { - Close(Constants.ReplySuccess, "Goodbye", Timeout.InfiniteTimeSpan); + Close(Constants.ReplySuccess, "Goodbye", TimeSpan.FromSeconds(30)); } ///API-side invocation of connection.close. public void Close(ushort reasonCode, string reasonText) { - Close(reasonCode, reasonText, Timeout.InfiniteTimeSpan); + Close(reasonCode, reasonText, TimeSpan.FromSeconds(30)); } ///API-side invocation of connection.close with timeout. @@ -1058,7 +1064,16 @@ internal OutgoingCommand ChannelCloseWrapper(ushort reasonCode, string reasonTex return request; } - void StartAndTune() + ///Used for testing only. + internal IFrameHandler FrameHandler + { + get + { + return _frameHandler; + } + } + + private void StartAndTune() { var connectionStartCell = new BlockingCell(); _model0.m_connectionStartCell = connectionStartCell; diff --git a/projects/RabbitMQ.Client/client/impl/SocketFrameHandler.cs b/projects/RabbitMQ.Client/client/impl/SocketFrameHandler.cs index 7ff75a9bf3..0ea782fc07 100644 --- a/projects/RabbitMQ.Client/client/impl/SocketFrameHandler.cs +++ b/projects/RabbitMQ.Client/client/impl/SocketFrameHandler.cs @@ -188,7 +188,11 @@ public void Close() { lock (_semaphore) { - if (!_closed) + if (_closed || _socket == null) + { + return; + } + else { try { diff --git a/projects/Unit/Fixtures.cs b/projects/Unit/Fixtures.cs index 16c9073165..f1e9e66df9 100644 --- a/projects/Unit/Fixtures.cs +++ b/projects/Unit/Fixtures.cs @@ -42,12 +42,10 @@ using NUnit.Framework; -using RabbitMQ.Client.Framing; using RabbitMQ.Client.Framing.Impl; namespace RabbitMQ.Client.Unit { - public class IntegrationFixture { internal IConnectionFactory ConnFactory; @@ -56,6 +54,12 @@ public class IntegrationFixture internal Encoding encoding = new UTF8Encoding(); public static TimeSpan RECOVERY_INTERVAL = TimeSpan.FromSeconds(2); + protected readonly string _testDisplayName; + + public IntegrationFixture() + { + _testDisplayName = TestContext.CurrentContext.Test.FullName; + } [SetUp] public virtual void Init() @@ -72,6 +76,7 @@ public void Dispose() { Model.Close(); } + if(Conn.IsOpen) { Conn.Close(); @@ -106,7 +111,7 @@ internal AutorecoveringConnection CreateAutorecoveringConnection(TimeSpan interv AutomaticRecoveryEnabled = true, NetworkRecoveryInterval = interval }; - return (AutorecoveringConnection)cf.CreateConnection($"UNIT_CONN:{Guid.NewGuid()}"); + return (AutorecoveringConnection)cf.CreateConnection($"{_testDisplayName}:{Guid.NewGuid()}"); } internal AutorecoveringConnection CreateAutorecoveringConnection(TimeSpan interval, IList hostnames) @@ -119,7 +124,7 @@ internal AutorecoveringConnection CreateAutorecoveringConnection(TimeSpan interv RequestedConnectionTimeout = TimeSpan.FromSeconds(1), NetworkRecoveryInterval = interval }; - return (AutorecoveringConnection)cf.CreateConnection(hostnames, $"UNIT_CONN:{Guid.NewGuid()}"); + return (AutorecoveringConnection)cf.CreateConnection(hostnames, $"{_testDisplayName}:{Guid.NewGuid()}"); } internal AutorecoveringConnection CreateAutorecoveringConnection(IList endpoints) @@ -132,7 +137,7 @@ internal AutorecoveringConnection CreateAutorecoveringConnection(IList action) { diff --git a/projects/Unit/TestBasicGet.cs b/projects/Unit/TestBasicGet.cs index 621e56fa70..3c94a921e6 100644 --- a/projects/Unit/TestBasicGet.cs +++ b/projects/Unit/TestBasicGet.cs @@ -38,6 +38,10 @@ namespace RabbitMQ.Client.Unit [TestFixture] public class TestBasicGet : IntegrationFixture { + public TestBasicGet() : base() + { + } + [Test] public void TestBasicGetWithClosedChannel() { diff --git a/projects/Unit/TestBasicPublishBatch.cs b/projects/Unit/TestBasicPublishBatch.cs index 32effd553f..b188f5f080 100644 --- a/projects/Unit/TestBasicPublishBatch.cs +++ b/projects/Unit/TestBasicPublishBatch.cs @@ -35,8 +35,12 @@ namespace RabbitMQ.Client.Unit { - internal class TestBasicPublishBatch : IntegrationFixture + public class TestBasicPublishBatch : IntegrationFixture { + public TestBasicPublishBatch() : base() + { + } + [Test] public void TestBasicPublishBatchSend() { diff --git a/projects/Unit/TestConcurrentAccessWithSharedConnection.cs b/projects/Unit/TestConcurrentAccessWithSharedConnection.cs index 1be0b3ebec..034cb603b8 100644 --- a/projects/Unit/TestConcurrentAccessWithSharedConnection.cs +++ b/projects/Unit/TestConcurrentAccessWithSharedConnection.cs @@ -42,11 +42,14 @@ namespace RabbitMQ.Client.Unit [TestFixture] public class TestConcurrentAccessWithSharedConnection : IntegrationFixture { - internal const int Threads = 32; internal CountdownEvent _latch; internal TimeSpan _completionTimeout = TimeSpan.FromSeconds(90); + public TestConcurrentAccessWithSharedConnection() : base() + { + } + [SetUp] public override void Init() { diff --git a/projects/Unit/TestConfirmSelect.cs b/projects/Unit/TestConfirmSelect.cs index 2cfa73071e..3886addad8 100644 --- a/projects/Unit/TestConfirmSelect.cs +++ b/projects/Unit/TestConfirmSelect.cs @@ -34,7 +34,11 @@ namespace RabbitMQ.Client.Unit { [TestFixture] - public class TestConfirmSelect : IntegrationFixture { + public class TestConfirmSelect : IntegrationFixture + { + public TestConfirmSelect() : base() + { + } [Test] public void TestConfirmSelectIdempotency() diff --git a/projects/Unit/TestConnectionBlocked.cs b/projects/Unit/TestConnectionBlocked.cs index 9c6f17dd1e..7eebee2a7f 100644 --- a/projects/Unit/TestConnectionBlocked.cs +++ b/projects/Unit/TestConnectionBlocked.cs @@ -44,12 +44,15 @@ public class TestConnectionBlocked : IntegrationFixture private readonly object _lockObject = new object(); private bool _notified; + public TestConnectionBlocked() : base() + { + } + public void HandleBlocked(object sender, ConnectionBlockedEventArgs args) { Unblock(); } - public void HandleUnblocked(object sender, EventArgs ea) { lock (_lockObject) diff --git a/projects/Unit/TestConnectionFactoryContinuationTimeout.cs b/projects/Unit/TestConnectionFactoryContinuationTimeout.cs index 416d9351e7..6ddb4d0df7 100644 --- a/projects/Unit/TestConnectionFactoryContinuationTimeout.cs +++ b/projects/Unit/TestConnectionFactoryContinuationTimeout.cs @@ -35,8 +35,12 @@ namespace RabbitMQ.Client.Unit { [TestFixture] - internal class TestConnectionFactoryContinuationTimeout : IntegrationFixture + public class TestConnectionFactoryContinuationTimeout : IntegrationFixture { + public TestConnectionFactoryContinuationTimeout() : base() + { + } + [Test] public void TestConnectionFactoryContinuationTimeoutOnRecoveringConnection() { diff --git a/projects/Unit/TestConnectionRecovery.cs b/projects/Unit/TestConnectionRecovery.cs index a862eba573..62d312b592 100644 --- a/projects/Unit/TestConnectionRecovery.cs +++ b/projects/Unit/TestConnectionRecovery.cs @@ -52,7 +52,7 @@ public class TestConnectionRecovery : IntegrationFixture private readonly ushort _closeAtCount = 16; private string _queueName; - public TestConnectionRecovery() + public TestConnectionRecovery() : base() { var rnd = new Random(); _messageBody = new byte[4096]; @@ -68,10 +68,19 @@ public override void Init() Model.QueueDelete(_queueName); } - [TearDown] - public void CleanUp() + protected override void ReleaseResources() { - Conn.Close(); + if (Model.IsOpen) + { + Model.Close(); + } + + if (Conn.IsOpen) + { + Conn.Close(); + } + + Unblock(); } [Test] @@ -1108,11 +1117,6 @@ internal ManualResetEventSlim PrepareForShutdown(IConnection conn) return latch; } - protected override void ReleaseResources() - { - Unblock(); - } - internal void RestartServerAndWaitForRecovery() { RestartServerAndWaitForRecovery((IAutorecoveringConnection)Conn); diff --git a/projects/Unit/TestConnectionShutdown.cs b/projects/Unit/TestConnectionShutdown.cs index f2c1477c2e..6b131e00b8 100644 --- a/projects/Unit/TestConnectionShutdown.cs +++ b/projects/Unit/TestConnectionShutdown.cs @@ -35,12 +35,81 @@ using NUnit.Framework; using RabbitMQ.Client.Impl; +using RabbitMQ.Client.Framing.Impl; namespace RabbitMQ.Client.Unit { [TestFixture] public class TestConnectionShutdown : IntegrationFixture { + public TestConnectionShutdown() : base() + { + } + + [Test] + public void TestCleanClosureWithSocketClosedOutOfBand() + { + using (IConnection conn = CreateAutorecoveringConnection()) + { + using (IModel model = conn.CreateModel()) + { + var latch = new ManualResetEventSlim(false); + model.ModelShutdown += (m, args) => { + latch.Set(); + }; + + var c = (AutorecoveringConnection)conn; + c.FrameHandler.Close(); + + conn.Close(TimeSpan.FromSeconds(4)); + Wait(latch, TimeSpan.FromSeconds(5)); + } + } + } + + [Test] + public void TestAbortWithSocketClosedOutOfBand() + { + using (IConnection conn = CreateAutorecoveringConnection()) + { + using (IModel model = conn.CreateModel()) + { + var latch = new ManualResetEventSlim(false); + model.ModelShutdown += (m, args) => { + latch.Set(); + }; + + var c = (AutorecoveringConnection)conn; + c.FrameHandler.Close(); + + conn.Abort(); + // default Connection.Abort() timeout and then some + Wait(latch, TimeSpan.FromSeconds(6)); + } + } + } + + [Test] + public void TestDisposedWithSocketClosedOutOfBand() + { + using (IConnection conn = CreateAutorecoveringConnection()) + { + using (IModel model = conn.CreateModel()) + { + var latch = new ManualResetEventSlim(false); + model.ModelShutdown += (m, args) => { + latch.Set(); + }; + + var c = (AutorecoveringConnection)conn; + c.FrameHandler.Close(); + + conn.Dispose(); + Wait(latch, TimeSpan.FromSeconds(3)); + } + } + } + [Test] public void TestShutdownSignalPropagationToChannels() { diff --git a/projects/Unit/TestConsumerCount.cs b/projects/Unit/TestConsumerCount.cs index 3885ea0679..d652de5002 100644 --- a/projects/Unit/TestConsumerCount.cs +++ b/projects/Unit/TestConsumerCount.cs @@ -35,8 +35,13 @@ namespace RabbitMQ.Client.Unit { - internal class TestConsumerCount : IntegrationFixture + [TestFixture] + public class TestConsumerCount : IntegrationFixture { + public TestConsumerCount() : base() + { + } + [Test] public void TestConsumerCountMethod() { diff --git a/projects/Unit/TestConsumerExceptions.cs b/projects/Unit/TestConsumerExceptions.cs index 7c87a3c797..3151339750 100644 --- a/projects/Unit/TestConsumerExceptions.cs +++ b/projects/Unit/TestConsumerExceptions.cs @@ -39,6 +39,10 @@ namespace RabbitMQ.Client.Unit [TestFixture] public class TestConsumerExceptions : IntegrationFixture { + public TestConsumerExceptions() : base() + { + } + private class ConsumerFailingOnDelivery : DefaultBasicConsumer { public ConsumerFailingOnDelivery(IModel model) : base(model) diff --git a/projects/Unit/TestConsumerOperationDispatch.cs b/projects/Unit/TestConsumerOperationDispatch.cs index 7ab97cf4b9..37b0af7973 100644 --- a/projects/Unit/TestConsumerOperationDispatch.cs +++ b/projects/Unit/TestConsumerOperationDispatch.cs @@ -41,7 +41,7 @@ namespace RabbitMQ.Client.Unit { [TestFixture] - internal class TestConsumerOperationDispatch : IntegrationFixture + public class TestConsumerOperationDispatch : IntegrationFixture { private readonly string _x = "dotnet.tests.consumer-operation-dispatch.fanout"; private readonly List _channels = new List(); @@ -56,6 +56,10 @@ internal class TestConsumerOperationDispatch : IntegrationFixture public static CountdownEvent counter = new CountdownEvent(Y); + public TestConsumerOperationDispatch() : base() + { + } + [TearDown] protected override void ReleaseResources() { diff --git a/projects/Unit/TestEventingConsumer.cs b/projects/Unit/TestEventingConsumer.cs index 988907f0e3..d2ac17ea3b 100644 --- a/projects/Unit/TestEventingConsumer.cs +++ b/projects/Unit/TestEventingConsumer.cs @@ -38,7 +38,11 @@ namespace RabbitMQ.Client.Unit { [TestFixture] - public class TestEventingConsumer : IntegrationFixture { + public class TestEventingConsumer : IntegrationFixture + { + public TestEventingConsumer() : base() + { + } [Test] public void TestEventingConsumerRegistrationEvents() diff --git a/projects/Unit/TestExceptionMessages.cs b/projects/Unit/TestExceptionMessages.cs index fd57cb2721..1aef9c702f 100644 --- a/projects/Unit/TestExceptionMessages.cs +++ b/projects/Unit/TestExceptionMessages.cs @@ -40,6 +40,10 @@ namespace RabbitMQ.Client.Unit [TestFixture] public class TestExceptionMessages : IntegrationFixture { + public TestExceptionMessages() : base() + { + } + [Test] public void TestAlreadyClosedExceptionMessage() { diff --git a/projects/Unit/TestExchangeDeclare.cs b/projects/Unit/TestExchangeDeclare.cs index b576adfab0..d4ea6949d2 100644 --- a/projects/Unit/TestExchangeDeclare.cs +++ b/projects/Unit/TestExchangeDeclare.cs @@ -38,7 +38,11 @@ namespace RabbitMQ.Client.Unit { [TestFixture] - public class TestExchangeDeclare : IntegrationFixture { + public class TestExchangeDeclare : IntegrationFixture + { + public TestExchangeDeclare() : base() + { + } [Test] [Category("RequireSMP")] diff --git a/projects/Unit/TestExtensions.cs b/projects/Unit/TestExtensions.cs index 9aa6a948e3..d4eee360a7 100644 --- a/projects/Unit/TestExtensions.cs +++ b/projects/Unit/TestExtensions.cs @@ -38,6 +38,10 @@ namespace RabbitMQ.Client.Unit [TestFixture] public class TestExtensions : IntegrationFixture { + public TestExtensions() : base() + { + } + [Test] public void TestConfirmBarrier() { diff --git a/projects/Unit/TestHeartbeats.cs b/projects/Unit/TestHeartbeats.cs index af08637227..3d15f55e23 100644 --- a/projects/Unit/TestHeartbeats.cs +++ b/projects/Unit/TestHeartbeats.cs @@ -39,10 +39,14 @@ namespace RabbitMQ.Client.Unit { [TestFixture] - internal class TestHeartbeats : IntegrationFixture + public class TestHeartbeats : IntegrationFixture { private readonly TimeSpan _heartbeatTimeout = TimeSpan.FromSeconds(2); + public TestHeartbeats() : base() + { + } + [Test, Category("LongRunning"), MaxTimeAttribute(35000)] public void TestThatHeartbeatWriterUsesConfigurableInterval() { diff --git a/projects/Unit/TestInitialConnection.cs b/projects/Unit/TestInitialConnection.cs index b3e35f2fe7..2dc828b35a 100644 --- a/projects/Unit/TestInitialConnection.cs +++ b/projects/Unit/TestInitialConnection.cs @@ -40,6 +40,10 @@ namespace RabbitMQ.Client.Unit [TestFixture] public class TestInitialConnection : IntegrationFixture { + public TestInitialConnection() : base() + { + } + [Test] public void TestBasicConnectionRecoveryWithHostnameList() { diff --git a/projects/Unit/TestInvalidAck.cs b/projects/Unit/TestInvalidAck.cs index 202cc44b79..ceac3bdae8 100644 --- a/projects/Unit/TestInvalidAck.cs +++ b/projects/Unit/TestInvalidAck.cs @@ -36,7 +36,11 @@ namespace RabbitMQ.Client.Unit { [TestFixture] - public class TestInvalidAck : IntegrationFixture { + public class TestInvalidAck : IntegrationFixture + { + public TestInvalidAck() : base() + { + } [Test] public void TestAckWithUnknownConsumerTagAndMultipleFalse() diff --git a/projects/Unit/TestMainLoop.cs b/projects/Unit/TestMainLoop.cs index 5a0917aac8..4d9400689a 100644 --- a/projects/Unit/TestMainLoop.cs +++ b/projects/Unit/TestMainLoop.cs @@ -39,7 +39,11 @@ namespace RabbitMQ.Client.Unit { [TestFixture] - public class TestMainLoop : IntegrationFixture { + public class TestMainLoop : IntegrationFixture + { + public TestMainLoop() : base() + { + } private class FaultyConsumer : DefaultBasicConsumer { diff --git a/projects/Unit/TestMessageCount.cs b/projects/Unit/TestMessageCount.cs index bdeff31d27..e4f254641c 100644 --- a/projects/Unit/TestMessageCount.cs +++ b/projects/Unit/TestMessageCount.cs @@ -35,8 +35,13 @@ namespace RabbitMQ.Client.Unit { - internal class TestMessageCount : IntegrationFixture + [TestFixture] + public class TestMessageCount : IntegrationFixture { + public TestMessageCount() : base() + { + } + [Test] public void TestMessageCountMethod() { diff --git a/projects/Unit/TestModelShutdown.cs b/projects/Unit/TestModelShutdown.cs index a5e41f817a..386620d768 100644 --- a/projects/Unit/TestModelShutdown.cs +++ b/projects/Unit/TestModelShutdown.cs @@ -39,8 +39,12 @@ namespace RabbitMQ.Client.Unit { [TestFixture] - internal class TestModelShutdown : IntegrationFixture + public class TestModelShutdown : IntegrationFixture { + public TestModelShutdown() : base() + { + } + [Test] public void TestConsumerDispatcherShutdown() { diff --git a/projects/Unit/TestNowait.cs b/projects/Unit/TestNowait.cs index 5269bff4ac..b950abdd43 100644 --- a/projects/Unit/TestNowait.cs +++ b/projects/Unit/TestNowait.cs @@ -34,7 +34,12 @@ namespace RabbitMQ.Client.Unit { [TestFixture] - public class TestNoWait : IntegrationFixture { + public class TestNoWait : IntegrationFixture + { + public TestNoWait() : base() + { + } + [Test] public void TestQueueDeclareNoWait() { diff --git a/projects/Unit/TestPassiveDeclare.cs b/projects/Unit/TestPassiveDeclare.cs index e695e41bfd..ff2b8cf56b 100644 --- a/projects/Unit/TestPassiveDeclare.cs +++ b/projects/Unit/TestPassiveDeclare.cs @@ -40,6 +40,10 @@ namespace RabbitMQ.Client.Unit [TestFixture] public class TestPassiveDeclare : IntegrationFixture { + public TestPassiveDeclare() : base() + { + } + [Test] public void TestPassiveExchangeDeclareWhenExchangeDoesNotExist() { diff --git a/projects/Unit/TestPublishValidation.cs b/projects/Unit/TestPublishValidation.cs index c5806051d4..3c55d43db2 100644 --- a/projects/Unit/TestPublishValidation.cs +++ b/projects/Unit/TestPublishValidation.cs @@ -38,6 +38,9 @@ namespace RabbitMQ.Client.Unit [TestFixture] public class TestPublishValidation : IntegrationFixture { + public TestPublishValidation() : base() + { + } [Test] public void TestNullRoutingKeyIsRejected() diff --git a/projects/Unit/TestPublisherConfirms.cs b/projects/Unit/TestPublisherConfirms.cs index 74efbca270..96116f7e1f 100644 --- a/projects/Unit/TestPublisherConfirms.cs +++ b/projects/Unit/TestPublisherConfirms.cs @@ -43,6 +43,10 @@ public class TestPublisherConfirms : IntegrationFixture { private const string QueueName = "RabbitMQ.Client.Unit.TestPublisherConfirms"; + public TestPublisherConfirms() : base() + { + } + [Test] public void TestWaitForConfirmsWithoutTimeout() { diff --git a/projects/Unit/TestQueueDeclare.cs b/projects/Unit/TestQueueDeclare.cs index 4fd99735dd..6e2d8c80ce 100644 --- a/projects/Unit/TestQueueDeclare.cs +++ b/projects/Unit/TestQueueDeclare.cs @@ -38,7 +38,11 @@ namespace RabbitMQ.Client.Unit { [TestFixture] - public class TestQueueDeclare : IntegrationFixture { + public class TestQueueDeclare : IntegrationFixture + { + public TestQueueDeclare() : base() + { + } [Test] [Category("RequireSMP")] diff --git a/projects/Unit/TestSsl.cs b/projects/Unit/TestSsl.cs index d25f6d10c3..077d2e8508 100644 --- a/projects/Unit/TestSsl.cs +++ b/projects/Unit/TestSsl.cs @@ -129,7 +129,7 @@ public void TestNoClientCertificate() private void SendReceive(ConnectionFactory cf) { - using (IConnection conn = cf.CreateConnection($"{_testDisplayName}:{Guid.NewGuid()}")) + using (IConnection conn = cf.CreateConnection($"{this.GetType().FullName}:{Guid.NewGuid()}")) { using (IModel ch = conn.CreateModel()) {