This is an automated email from the ASF dual-hosted git repository. havret pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/activemq-nms-openwire.git
commit c225be37fd507ffa174fef465494064271d01524 Author: Havret <[email protected]> AuthorDate: Fri Aug 15 16:06:34 2025 +0200 NO-JIRA Add test timeouts # Conflicts: # test/Transport/Inactivity/InactivityMonitorTest.cs --- test/AMQNET375Test.cs | 5 +-- test/AMQRedeliveryPolicyTest.cs | 20 ++++----- test/AMQTransactionTestSupport.cs | 28 ++++++------ test/Async/ConnectionFactoryTestAsync.cs | 6 +-- test/Async/MessageConsumerTestAsync.cs | 8 ++-- test/Async/MessageProducerTestAsync.cs | 9 ++-- test/BatchedMessagePriorityConsumerTest.cs | 4 +- test/BrokerToNMSExceptionsTest.cs | 4 +- test/Commands/ActiveMQMapMessageTest.cs | 2 +- test/Commands/MessageCompressionTest.cs | 10 ++--- test/ConnectionFactoryTest.cs | 10 ++--- test/DtcBasicTransactionsTest.cs | 6 +-- test/DtcConsumerTransactionsTest.cs | 28 ++++++------ test/DtcProducerTransactionsTest.cs | 18 ++++---- test/ExclusiveConsumerTest.cs | 12 +++--- test/IndividualAckTest.cs | 14 +++--- test/InvalidCredentialsTest.cs | 2 +- test/MessageConsumerTest.cs | 10 ++--- test/MessageListenerRedeliveryTest.cs | 10 ++--- test/MessageProducerTest.cs | 6 +-- test/NMSConnectionFactoryTest.cs | 11 ++--- test/NMSConsumerTest.cs | 8 ++-- test/NMSProducerTest.cs | 6 +-- test/NMSSessionRecoverTest.cs | 13 +++--- test/NetTxConnectionFactoryTest.cs | 16 +++---- test/NetTxTransactionTest.cs | 8 ++-- test/NonBlockingConsumerRedeliveryTest.cs | 13 +++--- test/OpenWire/MaxInactivityDurationTest.cs | 4 +- test/OpenWire/PrefetchSizeZeroTest.cs | 2 +- test/OptimizedAckTest.cs | 7 ++- test/QueueBrowserTests.cs | 10 ++--- test/QueueConsumerPriorityTest.cs | 2 +- test/RollbackRedeliveryTest.cs | 16 +++---- test/TempDestinationTest.cs | 21 +++++---- test/Threads/CompositeTaskRunnerTest.cs | 4 +- test/Threads/DedicatedTaskRunnerTest.cs | 2 +- test/Threads/SchedulerTest.cs | 14 +++--- test/Threads/ThreadPoolExecutorTest.cs | 16 +++---- test/Threads/TimerExTest.cs | 50 +++++++++++----------- test/Transport/Inactivity/InactivityMonitorTest.cs | 8 ++-- test/Transport/Tcp/TcpFaultyTransportTest.cs | 2 +- test/Transport/failover/FailoverTransactionTest.cs | 9 ++-- test/Transport/failover/FailoverTransportTest.cs | 34 +++++++-------- test/Util/FifoMessageDispatchChannelTest.cs | 20 ++++----- .../SimplePriorityMessageDispatchChannelTest.cs | 20 ++++----- test/VirtualTopicTest.cs | 4 +- test/ZeroPrefetchConsumerTest.cs | 12 +++--- 47 files changed, 267 insertions(+), 277 deletions(-) diff --git a/test/AMQNET375Test.cs b/test/AMQNET375Test.cs index acd40bc..1a9f858 100644 --- a/test/AMQNET375Test.cs +++ b/test/AMQNET375Test.cs @@ -25,7 +25,7 @@ using NUnit.Framework; namespace Apache.NMS.ActiveMQ.Test { - [TestFixture()] + [TestFixture] public class AMQNET375Test : NMSTestSupport { #region Constants @@ -41,7 +41,7 @@ namespace Apache.NMS.ActiveMQ.Test #endregion - [TestCase] + [Test, Timeout(20_000)] public void TestZeroPrefetchConsumerGetsAllMessages() { Send(COUNT); @@ -123,4 +123,3 @@ namespace Apache.NMS.ActiveMQ.Test } } } - diff --git a/test/AMQRedeliveryPolicyTest.cs b/test/AMQRedeliveryPolicyTest.cs index 2ebdf0d..5e0c64c 100644 --- a/test/AMQRedeliveryPolicyTest.cs +++ b/test/AMQRedeliveryPolicyTest.cs @@ -30,7 +30,7 @@ namespace Apache.NMS.ActiveMQ.Test private const string DESTINATION_NAME = "TEST.RedeliveryPolicyTestDest"; private const string DLQ_DELIVERY_FAILURE_CAUSE_PROPERTY = "dlqDeliveryFailureCause"; - [Test] + [Test, Timeout(20_000)] public void TestExponentialRedeliveryPolicyDelaysDeliveryOnRollback() { using(Connection connection = (Connection) CreateConnection()) @@ -84,7 +84,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestNornalRedeliveryPolicyDelaysDeliveryOnRollback() { using(Connection connection = (Connection) CreateConnection()) @@ -134,7 +134,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestDLQHandling() { using(Connection connection = (Connection) CreateConnection()) @@ -195,7 +195,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestInfiniteMaximumNumberOfRedeliveries() { using(Connection connection = (Connection) CreateConnection()) @@ -258,7 +258,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestZeroMaximumNumberOfRedeliveries() { using(Connection connection = (Connection) CreateConnection()) @@ -295,7 +295,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestURIForRedeliverPolicyHandling() { string uri1 = "activemq:tcp://${activemqhost}:61616" + @@ -346,7 +346,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestNornalRedeliveryPolicyOnRollbackUntilTimeToLive() { using(Connection connection = (Connection) CreateConnection()) @@ -395,7 +395,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestNornalRedeliveryPolicyOnRollbackUntilTimeToLiveCallback() { using(Connection connection = (Connection) CreateConnection()) @@ -446,7 +446,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestRepeatedRedeliveryReceiveNoCommit() { using(Connection connection = (Connection) CreateConnection()) @@ -513,7 +513,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestRepeatedRedeliveryOnMessageNoCommit() { using(Connection connection = (Connection) CreateConnection()) diff --git a/test/AMQTransactionTestSupport.cs b/test/AMQTransactionTestSupport.cs index ced1dac..546852b 100644 --- a/test/AMQTransactionTestSupport.cs +++ b/test/AMQTransactionTestSupport.cs @@ -119,7 +119,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.Pass("When getting here. It is ok"); } - [Test] + [Test, Timeout(20_000)] public void TestSendReceiveTransactedBatches() { ITextMessage message = session.CreateTextMessage("Batch IMessage"); @@ -147,7 +147,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestSendRollback() { IMessage[] outbound = new IMessage[] @@ -185,7 +185,7 @@ namespace Apache.NMS.ActiveMQ.Test AssertTextMessagesEqual(outbound, inbound, "Rollback did not work."); } - [Test] + [Test, Timeout(20_000)] public void TestSendSessionClose() { IMessage[] outbound = new IMessage[] { @@ -227,7 +227,7 @@ namespace Apache.NMS.ActiveMQ.Test AssertTextMessagesEqual(outbound, inbound, "Rollback did not work."); } - [Test] + [Test, Timeout(20_000)] public void TestSendSessionAndConnectionClose() { IMessage[] outbound = new IMessage[] { @@ -271,7 +271,7 @@ namespace Apache.NMS.ActiveMQ.Test AssertTextMessagesEqual(outbound, inbound, "Rollback did not work."); } - [Test] + [Test, Timeout(20_000)] public void TestReceiveRollback() { IMessage[] outbound = new IMessage[] { @@ -325,7 +325,7 @@ namespace Apache.NMS.ActiveMQ.Test AssertTextMessagesEqual(outbound, inbound, "Rollback did not work."); } - [Test] + [Test, Timeout(20_000)] public void TestReceiveTwoThenRollback() { IMessage[] outbound = new IMessage[] { @@ -380,7 +380,7 @@ namespace Apache.NMS.ActiveMQ.Test AssertTextMessagesEqual(outbound, inbound, "Rollback did not work."); } - [Test] + [Test, Timeout(20_000)] public void TestSendReceiveWithPrefetchOne() { SetPrefetchToOne(); ReconnectSession(); @@ -412,7 +412,7 @@ namespace Apache.NMS.ActiveMQ.Test CommitTx(); } - [Test] + [Test, Timeout(20_000)] public void TestReceiveTwoThenRollbackManyTimes() { for(int i = 0; i < 5; i++) @@ -421,21 +421,21 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestSendRollbackWithPrefetchOfOne() { SetPrefetchToOne(); TestSendRollback(); } - [Test] + [Test, Timeout(20_000)] public void TestReceiveRollbackWithPrefetchOfOne() { SetPrefetchToOne(); TestReceiveRollback(); } - [Test] + [Test, Timeout(20_000)] public void TestCloseConsumerBeforeCommit() { ITextMessage[] outbound = new ITextMessage[] { @@ -539,7 +539,7 @@ namespace Apache.NMS.ActiveMQ.Test return ((Connection) connection).PrefetchPolicy; } - [Test] + [Test, Timeout(20_000)] public void TestTransactionEventsFired() { IMessage[] outbound = new IMessage[] @@ -594,7 +594,7 @@ namespace Apache.NMS.ActiveMQ.Test AssertTextMessagesEqual(outbound, inbound, "Rollback did not work."); } - [Test] + [Test, Timeout(20_000)] public void TestMessageListenerGeneratesTxEvents() { messageReceived = false; @@ -666,7 +666,7 @@ namespace Apache.NMS.ActiveMQ.Test transactionRolledBack = true; } - [Test] + [Test, Timeout(20_000)] public void TestMessageListener() { // Send messages diff --git a/test/Async/ConnectionFactoryTestAsync.cs b/test/Async/ConnectionFactoryTestAsync.cs index 7ca7837..914e8b3 100644 --- a/test/Async/ConnectionFactoryTestAsync.cs +++ b/test/Async/ConnectionFactoryTestAsync.cs @@ -26,7 +26,7 @@ namespace Apache.NMS.ActiveMQ.Test.Async [TestFixture] public class ConnectionFactoryTestAsync : NMSTestSupport { - [Test] + [Test, Timeout(20_000)] [TestCase("tcp://${activemqhost}:61616")] [TestCase("tcp://${activemqhost}:61616")] [TestCase("tcp://${activemqhost}:61616/0.0.0.0:0")] @@ -99,7 +99,7 @@ namespace Apache.NMS.ActiveMQ.Test.Async } } - [Test, Sequential] + [Test, Sequential, Timeout(20_000)] public async Task TestConnectionFactorySetParams( [Values("tcp://${activemqhost}:61616", "activemq:tcp://${activemqhost}:61616")] string connectionURI, @@ -144,7 +144,7 @@ namespace Apache.NMS.ActiveMQ.Test.Async } } - [Test, Sequential] + [Test, Sequential, Timeout(20_000)] public async Task TestConnectionFactoryParseParams( [Values("tcp://${activemqhost}:61616", "activemq:tcp://${activemqhost}:61616")] string baseConnectionURI, diff --git a/test/Async/MessageConsumerTestAsync.cs b/test/Async/MessageConsumerTestAsync.cs index 3bcef29..fb77cf6 100644 --- a/test/Async/MessageConsumerTestAsync.cs +++ b/test/Async/MessageConsumerTestAsync.cs @@ -52,7 +52,7 @@ namespace Apache.NMS.ActiveMQ.Test.Async this.errorMessage = null; } - [Test] + [Test, Timeout(20_000)] public async Task TestBadSelectorDoesNotCloseConnection() { using (IConnection connection = CreateConnection(TEST_CLIENT_ID)) @@ -88,7 +88,7 @@ namespace Apache.NMS.ActiveMQ.Test.Async } } - [Test] + [Test, Timeout(20_000)] public async Task TestAsyncDispatchExceptionRedelivers() { using (IConnection connection = CreateConnection(TEST_CLIENT_ID)) @@ -173,7 +173,7 @@ namespace Apache.NMS.ActiveMQ.Test.Async } } - [Test] + [Test, Timeout(20_000)] public async Task ConsumeInTwoThreads() { ParameterizedThreadStart threadStart = @@ -215,7 +215,7 @@ namespace Apache.NMS.ActiveMQ.Test.Async } } - [Test] + [Test, Timeout(20_000)] public async Task TestReceiveIgnoreExpirationMessage( [Values(AcknowledgementMode.AutoAcknowledge, AcknowledgementMode.ClientAcknowledge, AcknowledgementMode.DupsOkAcknowledge, AcknowledgementMode.Transactional)] diff --git a/test/Async/MessageProducerTestAsync.cs b/test/Async/MessageProducerTestAsync.cs index 9ec9b19..d161833 100644 --- a/test/Async/MessageProducerTestAsync.cs +++ b/test/Async/MessageProducerTestAsync.cs @@ -26,8 +26,7 @@ namespace Apache.NMS.ActiveMQ.Test.Async public class MessageProducerTestAsync { - [Test] - [Timeout(20_000)] + [Test, Timeout(20_000)] public async Task TestProducerSendWithExpiry() { // Uri uri = new Uri(string.Format("tcp://localhost")); @@ -54,7 +53,7 @@ namespace Apache.NMS.ActiveMQ.Test.Async } - [Test][Timeout(20_000)] + [Test, Timeout(20_000)] public async Task TestProducerSendWithTimeout() { int timeout = 1500; @@ -90,7 +89,7 @@ namespace Apache.NMS.ActiveMQ.Test.Async } } - [Test] + [Test, Timeout(20_000)] public async Task TestCopyOnSend() { Uri uri = new Uri("mock://localhost:61616?connection.CopyMessageOnSend=true"); @@ -114,7 +113,7 @@ namespace Apache.NMS.ActiveMQ.Test.Async } } - [Test] + [Test, Timeout(20_000)] public async Task TestNoCopyOnSend() { Uri uri = new Uri("mock://localhost:61616?connection.CopyMessageOnSend=false"); diff --git a/test/BatchedMessagePriorityConsumerTest.cs b/test/BatchedMessagePriorityConsumerTest.cs index 0330e8c..149e566 100644 --- a/test/BatchedMessagePriorityConsumerTest.cs +++ b/test/BatchedMessagePriorityConsumerTest.cs @@ -31,13 +31,13 @@ namespace Apache.NMS.ActiveMQ.Test protected static string DESTINATION_NAME = "queue://TEST.BatchedMessagePriorityConsumerTest"; protected static string TEST_CLIENT_ID = "BatchedMessagePriorityConsumerTestID"; - [Test] + [Test, Timeout(20_000)] public void TestBatchWithLowPriorityFirstAndClientSupport() { DoTestBatchWithLowPriorityFirst(true); } - [Test] + [Test, Timeout(20_000)] public void testBatchWithLowPriorityFirstAndClientSupportOff() { DoTestBatchWithLowPriorityFirst(false); diff --git a/test/BrokerToNMSExceptionsTest.cs b/test/BrokerToNMSExceptionsTest.cs index df4fd20..d941a75 100644 --- a/test/BrokerToNMSExceptionsTest.cs +++ b/test/BrokerToNMSExceptionsTest.cs @@ -39,7 +39,7 @@ namespace Apache.NMS.ActiveMQ.Test base.TearDown(); } - [Test] + [Test, Timeout(20_000)] public void InvalidSelectorExceptionTest() { using(IConnection connection = CreateConnection()) @@ -58,7 +58,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void InvalidClientIdExceptionTest() { Uri uri = URISupport.CreateCompatibleUri(NMSTestSupport.ReplaceEnvVar(connectionURI)); diff --git a/test/Commands/ActiveMQMapMessageTest.cs b/test/Commands/ActiveMQMapMessageTest.cs index ecde5a6..8c42590 100644 --- a/test/Commands/ActiveMQMapMessageTest.cs +++ b/test/Commands/ActiveMQMapMessageTest.cs @@ -546,7 +546,7 @@ namespace Apache.NMS.ActiveMQ.Test.Commands msg.Body.GetString("string"); } - [Test] + [Test, Timeout(20_000)] public void TestMessageQueueDequeQueueDequeue() { using (IConnection connection = CreateConnection()) diff --git a/test/Commands/MessageCompressionTest.cs b/test/Commands/MessageCompressionTest.cs index 9259769..175a6eb 100644 --- a/test/Commands/MessageCompressionTest.cs +++ b/test/Commands/MessageCompressionTest.cs @@ -56,7 +56,7 @@ namespace Apache.NMS.ActiveMQ.Test protected float m = 2.1F; protected double n = 2.3; - [Test] + [Test, Timeout(20_000)] public void TestTextMessageCompression() { using(Connection connection = CreateConnection(TEST_CLIENT_ID) as Connection) @@ -86,7 +86,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestObjectMessageCompression() { using(Connection connection = CreateConnection(TEST_CLIENT_ID) as Connection) @@ -116,7 +116,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestStreamMessageCompression() { using(Connection connection = CreateConnection(TEST_CLIENT_ID) as Connection) @@ -176,7 +176,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestMapMessageCompression() { using(Connection connection = CreateConnection(TEST_CLIENT_ID) as Connection) @@ -235,7 +235,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestBytesMessageCompression() { using(Connection connection = CreateConnection(TEST_CLIENT_ID) as Connection) diff --git a/test/ConnectionFactoryTest.cs b/test/ConnectionFactoryTest.cs index 7d48ecd..0f2f0b5 100644 --- a/test/ConnectionFactoryTest.cs +++ b/test/ConnectionFactoryTest.cs @@ -28,7 +28,7 @@ namespace Apache.NMS.ActiveMQ.Test [TestFixture] public class ConnectionFactoryTest : NMSTestSupport { - [Test] + [Test, Timeout(20_000)] [TestCase("tcp://${activemqhost}:61616")] [TestCase("tcp://${activemqhost}:61616")] [TestCase("tcp://${activemqhost}:61616/0.0.0.0:0")] @@ -101,7 +101,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test, Sequential] + [Test, Sequential, Timeout(20_000)] public void TestConnectionFactorySetParams( [Values("tcp://${activemqhost}:61616", "activemq:tcp://${activemqhost}:61616")] string connectionURI, @@ -146,7 +146,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test, Sequential] + [Test, Sequential, Timeout(20_000)] public void TestConnectionFactoryParseParams( [Values("tcp://${activemqhost}:61616", "activemq:tcp://${activemqhost}:61616")] string baseConnectionURI, @@ -193,8 +193,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Timeout(10_000)] - [Test] + [Test, Timeout(20_000)] public void TestConnectionStartupDontDeadlockOnSingleThreadedSynchContext() { var singleContext = new SingleThreadSimpleTestSynchronizationContext(); @@ -216,4 +215,3 @@ namespace Apache.NMS.ActiveMQ.Test } } } - diff --git a/test/DtcBasicTransactionsTest.cs b/test/DtcBasicTransactionsTest.cs index 4d06bbe..116a283 100644 --- a/test/DtcBasicTransactionsTest.cs +++ b/test/DtcBasicTransactionsTest.cs @@ -35,7 +35,7 @@ namespace Apache.NMS.ActiveMQ.Test this.dtcFactory.ConfiguredResourceManagerId = Guid.NewGuid().ToString(); } - [Test] + [Test, Timeout(20_000)] [ExpectedException(typeof(NMSException))] public void TestSessionCreateFailsWithInvalidLogLocation() { @@ -51,7 +51,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestTransactedDBReadAndProduce() { // Test initialize - Fills in DB with data to send. @@ -74,7 +74,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyBrokerQueueCount(); } - [Test] + [Test, Timeout(20_000)] public void TestTransacteDequeueAndDbWrite() { // Test initialize - Fills in DB with data to send. diff --git a/test/DtcConsumerTransactionsTest.cs b/test/DtcConsumerTransactionsTest.cs index c4c77d1..dfbf98d 100644 --- a/test/DtcConsumerTransactionsTest.cs +++ b/test/DtcConsumerTransactionsTest.cs @@ -40,7 +40,7 @@ namespace Apache.NMS.ActiveMQ.Test this.dtcFactory.ConfiguredResourceManagerId = Guid.NewGuid().ToString(); } - [Test] + [Test, Timeout(20_000)] public void TestRedelivered() { // enqueue several messages @@ -101,7 +101,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestRedeliveredCase2() { const int messageCount = 300; @@ -172,7 +172,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestRedeliveredCase3() { const int messageCount = 300; @@ -242,7 +242,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestRedeliveredNoComplete() { const int messageCount = 300; @@ -312,7 +312,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestRecoveryAfterCommitFailsBeforeSent() { // Test initialize - Fills in queue with data to send and clears the DB. @@ -344,7 +344,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyNoMessagesInQueue(); } - [Test] + [Test, Timeout(20_000)] public void TestRecoveryAfterCommitFailsAfterSent() { // Test initialize - Fills in queue with data to send and clears the DB. @@ -376,7 +376,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyNoMessagesInQueue(); } - [Test] + [Test, Timeout(20_000)] public void TestIterativeTransactedConsume() { // Test initialize - Fills in queue with data to send and clears the DB. @@ -404,7 +404,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyNoMessagesInQueueNoRecovery(); } - [Test] + [Test, Timeout(20_000)] public void TestConsumeWithDBInsertLogLocation() { const string logLocation = @".\RecoveryDir"; @@ -453,7 +453,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.AreEqual(0, Directory.GetFiles(logLocation).Length); } - [Test] + [Test, Timeout(20_000)] public void TestRecoverAfterTransactionScopeAborted() { // Test initialize - Fills in queue with data to send and clears the DB. @@ -478,7 +478,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyBrokerQueueCount(); } - [Test] + [Test, Timeout(20_000)] public void TestRecoverAfterRollbackFailWhenScopeAborted() { // Test initialize - Fills in queue with data to send and clears the DB. @@ -508,7 +508,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyBrokerQueueCount(); } - [Test] + [Test, Timeout(20_000)] public void TestRecoverAfterFailOnTransactionBeforePrepareSent() { // Test initialize - Fills in queue with data to send and clears the DB. @@ -541,7 +541,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyBrokerQueueCount(); } - [Test] + [Test, Timeout(20_000)] public void TestRecoverAfterFailOnTransactionAfterPrepareSent() { // Test initialize - Fills in queue with data to send and clears the DB. @@ -574,7 +574,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyBrokerQueueCount(); } - [Test] + [Test, Timeout(20_000)] public void MessageShouldEnlistToTheCorrectTransaction() { const int messageCount = 100; @@ -662,7 +662,7 @@ namespace Apache.NMS.ActiveMQ.Test private DependentTransaction batchTxControl; private readonly ManualResetEvent awaitBatchProcessingStart = new ManualResetEvent(false); - [Test] + [Test, Timeout(20_000)] public void TestTransactedAsyncConsumption() { PurgeDatabase(); diff --git a/test/DtcProducerTransactionsTest.cs b/test/DtcProducerTransactionsTest.cs index 5569343..20f4c9f 100644 --- a/test/DtcProducerTransactionsTest.cs +++ b/test/DtcProducerTransactionsTest.cs @@ -38,7 +38,7 @@ namespace Apache.NMS.ActiveMQ.Test this.dtcFactory.ConfiguredResourceManagerId = Guid.NewGuid().ToString(); } - [Test] + [Test, Timeout(20_000)] public void TestRecoverAfterFailOnTransactionCommit() { // Test initialize - Fills in DB with data to send. @@ -70,7 +70,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyBrokerQueueCount(); } - [Test] + [Test, Timeout(20_000)] public void TestRecoverAfterFailOnTransactionPostCommitSend() { // Test initialize - Fills in DB with data to send. @@ -101,7 +101,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyBrokerQueueCount(); } - [Test] + [Test, Timeout(20_000)] public void TestNoRecoverAfterFailOnTransactionWhenLogDeleted() { // Test initialize - Fills in DB with data to send. @@ -142,7 +142,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyNoMessagesInQueue(); } - [Test] + [Test, Timeout(20_000)] public void TestNoRecoverAfterFailOnTransactionWhenLogWriteFails() { // Test initialize - Fills in DB with data to send. @@ -179,7 +179,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyNoMessagesInQueue(); } - [Test] + [Test, Timeout(20_000)] public void TestRecoverAfterFailOnTransactionBeforePrepareSent() { // Test initialize - Fills in DB with data to send. @@ -207,7 +207,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyNoMessagesInQueue(); } - [Test] + [Test, Timeout(20_000)] public void TestRecoverAfterFailOnTransactionDuringPrepareSend() { // Test initialize - Fills in DB with data to send. @@ -235,7 +235,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyNoMessagesInQueue(); } - [Test] + [Test, Timeout(20_000)] public void TestRecoverAfterTransactionScopeAborted() { // Test initialize - Fills in DB with data to send. @@ -258,7 +258,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyNoMessagesInQueue(); } - [Test] + [Test, Timeout(20_000)] public void TestRecoverAfterRollbackFailWhenScopeAborted() { // Test initialize - Fills in DB with data to send. @@ -289,7 +289,7 @@ namespace Apache.NMS.ActiveMQ.Test VerifyNoMessagesInQueue(); } - [Test] + [Test, Timeout(20_000)] public void TestIterativeTransactedProduceWithDBDelete() { using (INetTxConnection connection = dtcFactory.CreateNetTxConnection()) diff --git a/test/ExclusiveConsumerTest.cs b/test/ExclusiveConsumerTest.cs index 6c97e1e..c2e0690 100644 --- a/test/ExclusiveConsumerTest.cs +++ b/test/ExclusiveConsumerTest.cs @@ -52,7 +52,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Close(); } - [Test] + [Test, Timeout(20_000)] public void TestExclusiveConsumerSelectedCreatedFirst() { IConnection conn = createConnection(true); @@ -96,7 +96,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestExclusiveConsumerSelectedCreatedAfter() { IConnection conn = createConnection(true); @@ -140,7 +140,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestFailoverToAnotherExclusiveConsumerCreatedFirst() { IConnection conn = createConnection(true); @@ -200,7 +200,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestFailoverToAnotherExclusiveConsumerCreatedAfter() { IConnection conn = createConnection(true); @@ -263,7 +263,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestFailoverToNonExclusiveConsumer() { IConnection conn = createConnection(true); @@ -318,7 +318,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestFallbackToExclusiveConsumer() { IConnection conn = createConnection(true); diff --git a/test/IndividualAckTest.cs b/test/IndividualAckTest.cs index a1c68fb..042b161 100644 --- a/test/IndividualAckTest.cs +++ b/test/IndividualAckTest.cs @@ -42,7 +42,7 @@ namespace Apache.NMS.ActiveMQ.Test base.TearDown(); } - [Test] + [Test, Timeout(20_000)] public void TestAckedMessageAreConsumed() { ISession session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge); @@ -68,7 +68,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Close(); } - [Test] + [Test, Timeout(20_000)] public void TestLastMessageAcked() { ISession session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge); @@ -111,7 +111,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Close(); } - [Test] + [Test, Timeout(20_000)] public void TestUnAckedMessageAreNotConsumedOnSessionClose() { ISession session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge); @@ -138,7 +138,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Close(); } - [Test] + [Test, Timeout(20_000)] public void TestIndividualAcknowledgeMultiMessages_AcknowledgeFirstTest() { ISession session = connection.CreateSession(AcknowledgementMode.IndividualAcknowledge); @@ -182,7 +182,7 @@ namespace Apache.NMS.ActiveMQ.Test consumer.Close(); } - [Test] + [Test, Timeout(20_000)] public void TestManyMessageAckedAfterMessageConsumption() { int messageCount = 20; @@ -219,7 +219,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Close(); } - [Test] + [Test, Timeout(20_000)] public void TestManyMessageAckedAfterAllConsumption() { int messageCount = 20; @@ -261,7 +261,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Close(); } - [Test] + [Test, Timeout(20_000)] public void TestIndividualAcksWithClosedConsumerAndAuditSync() { const int MSG_COUNT = 20; diff --git a/test/InvalidCredentialsTest.cs b/test/InvalidCredentialsTest.cs index c6b0004..37d8d00 100644 --- a/test/InvalidCredentialsTest.cs +++ b/test/InvalidCredentialsTest.cs @@ -37,7 +37,7 @@ namespace Apache.NMS.ActiveMQ.Test } // Maximum time to run is 20 seconds. - [Test, Timeout(20000)] + [Test, Timeout(20_000)] public void TestRestartInvalidCredentialsWithFailover() { // To run this test successfully, the broker must have secure login enabled. diff --git a/test/MessageConsumerTest.cs b/test/MessageConsumerTest.cs index 86d493d..a67326c 100644 --- a/test/MessageConsumerTest.cs +++ b/test/MessageConsumerTest.cs @@ -52,7 +52,7 @@ namespace Apache.NMS.ActiveMQ.Test this.errorMessage = null; } - [Test] + [Test, Timeout(20_000)] public void TestBadSelectorDoesNotCloseConnection() { using (IConnection connection = CreateConnection(TEST_CLIENT_ID)) @@ -88,7 +88,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestAsyncDispatchExceptionRedelivers() { using (IConnection connection = CreateConnection(TEST_CLIENT_ID)) @@ -169,7 +169,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void ConsumeInTwoThreads() { ParameterizedThreadStart threadStart = @@ -211,7 +211,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestReceiveIgnoreExpirationMessage( [Values(AcknowledgementMode.AutoAcknowledge, AcknowledgementMode.ClientAcknowledge, AcknowledgementMode.DupsOkAcknowledge, AcknowledgementMode.Transactional)] @@ -343,7 +343,7 @@ namespace Apache.NMS.ActiveMQ.Test exception.Message); } - [Test] + [Test, Timeout(20_000)] public void TestShouldUseCustomDeserializationPolicy() { string uri = "activemq:tcp://${{activemqhost}}:61616"; diff --git a/test/MessageListenerRedeliveryTest.cs b/test/MessageListenerRedeliveryTest.cs index 17d4293..d838af5 100644 --- a/test/MessageListenerRedeliveryTest.cs +++ b/test/MessageListenerRedeliveryTest.cs @@ -127,7 +127,7 @@ namespace Apache.NMS.ActiveMQ.Test throw new Exception("Test Forcing a Rollback"); } - [Test] + [Test, Timeout(20_000)] public void TestQueueRollbackConsumerListener() { connection.Start(); @@ -177,7 +177,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Close(); } - [Test] + [Test, Timeout(20_000)] public void TestQueueRollbackSessionListener() { connection.Start(); @@ -224,7 +224,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Close(); } - [Test] + [Test, Timeout(20_000)] public void TestQueueSessionListenerExceptionRetry() { connection.Start(); @@ -254,7 +254,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Close(); } - [Test] + [Test, Timeout(20_000)] public void TestQueueSessionListenerExceptionDlq() { connection.Start(); @@ -304,7 +304,7 @@ namespace Apache.NMS.ActiveMQ.Test throw new Exception("Test force a redelivery"); } - [Test] + [Test, Timeout(20_000)] public void TestTransactedQueueSessionListenerExceptionDlq() { connection.Start(); diff --git a/test/MessageProducerTest.cs b/test/MessageProducerTest.cs index 389e4c3..b770fde 100644 --- a/test/MessageProducerTest.cs +++ b/test/MessageProducerTest.cs @@ -24,7 +24,7 @@ namespace Apache.NMS.ActiveMQ.Test [TestFixture] public class MessageProducerTest { - [Test] + [Test, Timeout(20_000)] public void TestProducerSendWithTimeout() { int timeout = 1500; @@ -60,7 +60,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestCopyOnSend() { Uri uri = new Uri("mock://localhost:61616?connection.CopyMessageOnSend=true"); @@ -84,7 +84,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestNoCopyOnSend() { Uri uri = new Uri("mock://localhost:61616?connection.CopyMessageOnSend=false"); diff --git a/test/NMSConnectionFactoryTest.cs b/test/NMSConnectionFactoryTest.cs index 5be6ff6..4320159 100644 --- a/test/NMSConnectionFactoryTest.cs +++ b/test/NMSConnectionFactoryTest.cs @@ -34,7 +34,7 @@ namespace Apache.NMS.ActiveMQ.Test private static String password = "guest"; private ConnectionInfo info = null; - [Test] + [Test, Timeout(20_000)] [TestCase("tcp://${activemqhost}:61616")] [TestCase("activemq:tcp://${activemqhost}:61616")] [TestCase("activemqnettx:tcp://${activemqhost}:61616")] @@ -102,6 +102,7 @@ namespace Apache.NMS.ActiveMQ.Test }); } + [Test, Timeout(20_000)] [TestCase("(tcp://${activemqhost}:61616,tcp://${activemqhost}:61616)")] [TestCase("tcp://${activemqhost}:61616,tcp://${activemqhost}:61616")] public void TestURIFailures_UriFormatException(string connectionURI) @@ -119,7 +120,7 @@ namespace Apache.NMS.ActiveMQ.Test }); } - [Test] + [Test, Timeout(20_000)] public void TestConnectionSendsAuthenticationData() { NMSConnectionFactory factory = new NMSConnectionFactory("activemq:mock://localhost:61616"); @@ -154,7 +155,7 @@ namespace Apache.NMS.ActiveMQ.Test await Task.CompletedTask; } - [Test] + [Test, Timeout(20_000)] [TestCase(1, 2, 3, 4, 5)] [TestCase(112, 212, 312, 412, 512)] public void TestURIForPrefetchHandling(int queuePreFetch, int queueBrowserPrefetch, int topicPrefetch, int durableTopicPrefetch, int maximumPendingMessageLimit) @@ -186,7 +187,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] [TestCase(0)] [TestCase(1)] [TestCase(1000)] @@ -213,7 +214,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestSetDeserializationPolicy() { string baseUri = "activemq:tcp://${{activemqhost}}:61616"; diff --git a/test/NMSConsumerTest.cs b/test/NMSConsumerTest.cs index e8a733f..8d956d5 100644 --- a/test/NMSConsumerTest.cs +++ b/test/NMSConsumerTest.cs @@ -44,7 +44,7 @@ namespace Apache.NMS.ActiveMQ.Test this.errorMessage = null; } - [Test] + [Test, Timeout(20_000)] public void TestBadSelectorDoesNotCloseConnection() { using (var context = CreateContext(TEST_CLIENT_ID)) @@ -75,7 +75,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test][Timeout(20_000)] + [Test, Timeout(20_000)] public void TestAsyncDispatchExceptionRedelivers() { using (var context = CreateContext(TEST_CLIENT_ID)) @@ -153,7 +153,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void ConsumeInTwoThreads() { ParameterizedThreadStart threadStart = @@ -195,7 +195,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test][Timeout(20_000)] + [Test, Timeout(20_000)] public void TestReceiveIgnoreExpirationMessage( [Values(AcknowledgementMode.AutoAcknowledge, AcknowledgementMode.ClientAcknowledge, AcknowledgementMode.DupsOkAcknowledge, AcknowledgementMode.Transactional)] diff --git a/test/NMSProducerTest.cs b/test/NMSProducerTest.cs index aded1a2..38df668 100644 --- a/test/NMSProducerTest.cs +++ b/test/NMSProducerTest.cs @@ -24,7 +24,7 @@ namespace Apache.NMS.ActiveMQ.Test [TestFixture] public class NMSProducerTest { - [Test] + [Test, Timeout(20_000)] public void TestProducerSendWithTimeout() { int timeout = 1500; @@ -59,7 +59,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestCopyOnSend() { Uri uri = new Uri("mock://localhost:61616?connection.CopyMessageOnSend=true"); @@ -82,7 +82,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestNoCopyOnSend() { Uri uri = new Uri("mock://localhost:61616?connection.CopyMessageOnSend=false"); diff --git a/test/NMSSessionRecoverTest.cs b/test/NMSSessionRecoverTest.cs index b3cdb53..d607ca0 100644 --- a/test/NMSSessionRecoverTest.cs +++ b/test/NMSSessionRecoverTest.cs @@ -55,42 +55,42 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestQueueSynchRecover() { destination = new ActiveMQQueue("TEST.Queue-" + DateTime.Now.Ticks); DoTestSynchRecover(); } - [Test] + [Test, Timeout(20_000)] public void TestQueueAsynchRecover() { destination = new ActiveMQQueue("TEST.Queue-" + DateTime.Now.Ticks); DoTestAsynchRecover(); } - [Test] + [Test, Timeout(20_000)] public void TestTopicSynchRecover() { destination = new ActiveMQTopic("TEST.Topic-" + DateTime.Now.Ticks); DoTestSynchRecover(); } - [Test] + [Test, Timeout(20_000)] public void TestTopicAsynchRecover() { destination = new ActiveMQTopic("TEST.Topic-" + DateTime.Now.Ticks); DoTestAsynchRecover(); } - [Test] + [Test, Timeout(20_000)] public void TestQueueAsynchRecoverWithAutoAck() { destination = new ActiveMQQueue("TEST.Queue-" + DateTime.Now.Ticks); DoTestAsynchRecoverWithAutoAck(); } - [Test] + [Test, Timeout(20_000)] public void TestTopicAsynchRecoverWithAutoAck() { destination = new ActiveMQTopic("TEST.Topic-" + DateTime.Now.Ticks); @@ -266,4 +266,3 @@ namespace Apache.NMS.ActiveMQ.Test } } } - diff --git a/test/NetTxConnectionFactoryTest.cs b/test/NetTxConnectionFactoryTest.cs index 55b8a7d..d9693be 100644 --- a/test/NetTxConnectionFactoryTest.cs +++ b/test/NetTxConnectionFactoryTest.cs @@ -29,7 +29,7 @@ namespace Apache.NMS.ActiveMQ.Test [TestFixture] public class NetTxConnectionFactoryTest : NMSTestSupport { - [Test] + [Test, Timeout(20_000)] [TestCase("tcp://${activemqhost}:61616")] [TestCase("tcp://${activemqhost}:61616")] [TestCase("tcp://${activemqhost}:61616/0.0.0.0:0")] @@ -104,7 +104,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test, Sequential] + [Test, Sequential, Timeout(20_000)] public void TestConnectionFactorySetParams( [Values("tcp://${activemqhost}:61616", "activemq:tcp://${activemqhost}:61616")] string connectionURI, @@ -149,7 +149,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test, Sequential] + [Test, Sequential, Timeout(20_000)] public void TestConnectionFactoryParseParams( [Values("tcp://${activemqhost}:61616", "activemq:tcp://${activemqhost}:61616")] string baseConnectionURI, @@ -196,7 +196,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestConfigureRecoveryPolicyLoggerType( [Values("tcp://${activemqhost}:61616?nms.RecoveryPolicy.RecoveryLoggerType=file")] string baseConnectionURI) @@ -219,7 +219,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] [TestCase("/var/log/nms/recovery/", true)] [TestCase("/var/temp/log/nms/recovery/", false)] [TestCase("C:\\Transactions\\RecoveryLogs", true)] @@ -251,7 +251,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] [TestCase("/var/log/nms/recovery/", true)] [TestCase("/var/temp/log/nms/recovery/", false)] public void TestConfigureRecoveryPolicyLoggerUsingDefaultLogger(string location, bool autoCreate) @@ -280,7 +280,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] [ExpectedException( typeof(Apache.NMS.NMSException))] public void TestConfigureRecoveryPolicyLoggerTypeWithInvalidType( [Values("tcp://${activemqhost}:61616?nms.RecoveryPolicy.RecoveryLoggerType=invalid")] @@ -292,5 +292,3 @@ namespace Apache.NMS.ActiveMQ.Test } } } - - diff --git a/test/NetTxTransactionTest.cs b/test/NetTxTransactionTest.cs index 6f9eecd..2c3a7ef 100644 --- a/test/NetTxTransactionTest.cs +++ b/test/NetTxTransactionTest.cs @@ -29,7 +29,7 @@ namespace Apache.NMS.ActiveMQ.Test { private const int MSG_COUNT = 50; - [Test] + [Test, Timeout(20_000)] public void TestTransactedProduceAndConsume( [Values("tcp://${activemqhost}:61616")] string baseConnectionURI) @@ -87,7 +87,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestTransactedProduceRollbackAndConsume( [Values("tcp://${activemqhost}:61616")] string baseConnectionURI) @@ -135,7 +135,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestTransactedProduceConsumeRollbackConsume( [Values("tcp://${activemqhost}:61616")] string baseConnectionURI) @@ -208,7 +208,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestTransactedProduceConsumeWithSessionClose( [Values("tcp://${activemqhost}:61616")] string baseConnectionURI) diff --git a/test/NonBlockingConsumerRedeliveryTest.cs b/test/NonBlockingConsumerRedeliveryTest.cs index b39a6c5..092ccc5 100644 --- a/test/NonBlockingConsumerRedeliveryTest.cs +++ b/test/NonBlockingConsumerRedeliveryTest.cs @@ -91,7 +91,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.AreEqual(count, target.Count, message); } - [Test] + [Test, Timeout(20_000)] public void testMessageDeleiveredWhenNonBlockingEnabled() { session = connection.CreateSession(AcknowledgementMode.Transactional); @@ -121,7 +121,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Commit(); } - [Test] + [Test, Timeout(20_000)] public void testMessageDeleiveredInCorrectOrder() { session = connection.CreateSession(AcknowledgementMode.Transactional); @@ -166,7 +166,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Commit(); } - [Test] + [Test, Timeout(20_000)] public void testMessageDeleiveryDoesntStop() { session = connection.CreateSession(AcknowledgementMode.Transactional); @@ -196,7 +196,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Commit(); } - [Test] + [Test, Timeout(20_000)] public void testNonBlockingMessageDeleiveryIsDelayed() { connection.RedeliveryPolicy.InitialRedeliveryDelay = 7000; @@ -252,7 +252,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void testNonBlockingMessageDeleiveryWithRollbacks() { session = connection.CreateSession(AcknowledgementMode.Transactional); @@ -290,7 +290,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Rollback(); } - [Test] + [Test, Timeout(20_000)] public void testNonBlockingMessageDeleiveryWithAllRolledBack() { connection.RedeliveryPolicy.MaximumRedeliveries = 3; @@ -344,4 +344,3 @@ namespace Apache.NMS.ActiveMQ.Test } } } - diff --git a/test/OpenWire/MaxInactivityDurationTest.cs b/test/OpenWire/MaxInactivityDurationTest.cs index 1f3c831..968ade3 100644 --- a/test/OpenWire/MaxInactivityDurationTest.cs +++ b/test/OpenWire/MaxInactivityDurationTest.cs @@ -30,7 +30,7 @@ namespace Apache.NMS.ActiveMQ.Test protected static string DESTINATION_NAME = "TEST.MaxInactivityDuration"; protected static string CORRELATION_ID = "MaxInactivityCorrelationID"; - [Test] + [Test, Timeout(20_000)] public void TestMaxInactivityDuration() { string testuri = "activemq:tcp://${activemqhost}:61616" + @@ -73,7 +73,7 @@ namespace Apache.NMS.ActiveMQ.Test producer.Send(request); } - [Test, Sequential] + [Test, Sequential, Timeout(20_000)] public void TestInactivityMonitorThreadLeak( [Values(0, 1000)] int inactivityDuration) diff --git a/test/OpenWire/PrefetchSizeZeroTest.cs b/test/OpenWire/PrefetchSizeZeroTest.cs index dcd7b62..6c01b22 100644 --- a/test/OpenWire/PrefetchSizeZeroTest.cs +++ b/test/OpenWire/PrefetchSizeZeroTest.cs @@ -28,7 +28,7 @@ namespace Apache.NMS.ActiveMQ.Test { protected static string DESTINATION_NAME = "TEST.PrefetchSizeZero"; - [Test] + [Test, Timeout(20_000)] public void TestZeroPrefetchSize() { using(IConnection connection = CreateConnection()) diff --git a/test/OptimizedAckTest.cs b/test/OptimizedAckTest.cs index 15a19a9..e1ca034 100644 --- a/test/OptimizedAckTest.cs +++ b/test/OptimizedAckTest.cs @@ -53,7 +53,7 @@ namespace Apache.NMS.ActiveMQ.Test base.TearDown(); } - [Test] + [Test, Timeout(20_000)] public void TestOptimizedAckWithExpiredMsgs() { ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge); @@ -107,7 +107,7 @@ namespace Apache.NMS.ActiveMQ.Test connection.Close(); } - [Test] + [Test, Timeout(20_000)] public void TestOptimizedAckWithExpiredMsgsSync() { ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge); @@ -157,7 +157,7 @@ namespace Apache.NMS.ActiveMQ.Test connection.Close(); } - [Test] + [Test, Timeout(20_000)] public void testOptimizedAckWithExpiredMsgsSync2() { ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge); @@ -223,4 +223,3 @@ namespace Apache.NMS.ActiveMQ.Test } } } - diff --git a/test/QueueBrowserTests.cs b/test/QueueBrowserTests.cs index 85c96db..121c754 100644 --- a/test/QueueBrowserTests.cs +++ b/test/QueueBrowserTests.cs @@ -29,7 +29,7 @@ namespace Apache.NMS.ActiveMQ.Test [TestFixture] public class QueueBrowserTests : NMSTestSupport { - [Test] + [Test, Timeout(20_000)] public void TestReceiveBrowseReceive() { using (IConnection connection = CreateConnection()) @@ -114,7 +114,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestBroserIteratively() { using (IConnection connection = CreateConnection()) @@ -145,7 +145,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestBrowseReceive() { using (IConnection connection = CreateConnection()) @@ -193,7 +193,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] [ExpectedException(typeof(NMSException))] public void TestCreateBrowserFailsWithZeroPrefetch() { @@ -207,7 +207,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestBrowsingExpiration() { const int MESSAGES_TO_SEND = 50; diff --git a/test/QueueConsumerPriorityTest.cs b/test/QueueConsumerPriorityTest.cs index 2d6b947..3932f06 100644 --- a/test/QueueConsumerPriorityTest.cs +++ b/test/QueueConsumerPriorityTest.cs @@ -96,7 +96,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestPriorityConsumption() { IConnection conn = createConnection(true); diff --git a/test/RollbackRedeliveryTest.cs b/test/RollbackRedeliveryTest.cs index 9256195..68fc4f7 100644 --- a/test/RollbackRedeliveryTest.cs +++ b/test/RollbackRedeliveryTest.cs @@ -58,7 +58,7 @@ namespace Apache.NMS.ActiveMQ.Test base.TearDown(); } - [Test] + [Test, Timeout(20_000)] public void TestRedelivery() { // Use non-interleaved producer and default prefetch. @@ -132,7 +132,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestRedeliveryOnSingleConsumer() { connection.Start(); @@ -170,7 +170,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestRedeliveryOnSingleSession() { connection.Start(); @@ -208,7 +208,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestMessageRedelivedMaxRedeliveriesTimesSingleSession() { connection.RedeliveryPolicy.MaximumRedeliveries = 15; @@ -251,7 +251,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestMessageRedelivedMaxRedeliveriesTimesMultipleSessions() { connection.RedeliveryPolicy.MaximumRedeliveries = 15; @@ -299,7 +299,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestValidateRedeliveryCountOnRollback() { const int numMessages = 1; @@ -333,7 +333,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestValidateRedeliveryCountOnRollbackWithPrefetch0() { const int numMessages = 1; @@ -381,7 +381,7 @@ namespace Apache.NMS.ActiveMQ.Test session.Close(); } - [Test] + [Test, Timeout(20_000)] public void TestRedeliveryPropertyWithNoRollback() { const int numMessages = 1; diff --git a/test/TempDestinationTest.cs b/test/TempDestinationTest.cs index 4cf2016..99b7ca3 100644 --- a/test/TempDestinationTest.cs +++ b/test/TempDestinationTest.cs @@ -78,7 +78,7 @@ namespace Apache.NMS.ActiveMQ.Test /// <summary> /// Make sure Temp destination can only be consumed by local connection /// </summary> - [Test] + [Test, Timeout(20_000)] public void TestTempDestOnlyConsumedByLocalConn() { Connection connection = GetNewConnection(); @@ -119,7 +119,7 @@ namespace Apache.NMS.ActiveMQ.Test /// <summary> /// Make sure that a temp queue does not drop message if there is an active consumers. /// </summary> - [Test] + [Test, Timeout(20_000)] public void TestTempQueueHoldsMessagesWithConsumers() { Connection connection = GetNewConnection(); @@ -142,7 +142,7 @@ namespace Apache.NMS.ActiveMQ.Test /// <summary> /// Make sure that a temp queue does not drop message if there are no active consumers. /// </summary> - [Test] + [Test, Timeout(20_000)] public void TestTempQueueHoldsMessagesWithoutConsumers() { Connection connection = GetNewConnection(); @@ -164,7 +164,7 @@ namespace Apache.NMS.ActiveMQ.Test /// <summary> /// Test temp queue works under load /// </summary> - [Test] + [Test, Timeout(20_000)] public void TestTmpQueueWorksUnderLoad() { int count = 500; @@ -201,7 +201,7 @@ namespace Apache.NMS.ActiveMQ.Test /// <summary> /// Make sure you cannot publish to a temp destination that does not exist anymore. /// </summary> - [Test] + [Test, Timeout(20_000)] public void TestPublishFailsForClosedConnection() { Connection connection = GetNewConnection(); @@ -244,7 +244,7 @@ namespace Apache.NMS.ActiveMQ.Test /// <summary> /// Make sure you cannot publish to a temp destination that does not exist anymore. /// </summary> - [Test] + [Test, Timeout(20_000)] public void TestPublishFailsForDestroyedTempDestination() { Connection connection = GetNewConnection(); @@ -285,7 +285,7 @@ namespace Apache.NMS.ActiveMQ.Test /// <summary> /// Make sure consumers work after a publisher fails to publish to deleted temp destination. /// </summary> - [Test] + [Test, Timeout(20_000)] [TestCase(MsgDeliveryMode.Persistent)] [TestCase(MsgDeliveryMode.NonPersistent)] public void TestConsumeAfterPublishFailsForDestroyedTempDestination(MsgDeliveryMode replyDeliveryMode) @@ -408,7 +408,7 @@ namespace Apache.NMS.ActiveMQ.Test /// <summary> /// Test you can't delete a Destination with Active Subscribers /// </summary> - [Test] + [Test, Timeout(20_000)] public void TestDeleteDestinationWithSubscribersFails() { Connection connection = GetNewConnection(); @@ -432,7 +432,7 @@ namespace Apache.NMS.ActiveMQ.Test /// <summary> /// Test clean up of multiple temp destinations /// </summary> - [Test] + [Test, Timeout(20_000)] public void TestCloseConnectionWithTempQueues() { List<ITemporaryQueue> listTempQueues = new List<ITemporaryQueue>(); @@ -450,7 +450,7 @@ namespace Apache.NMS.ActiveMQ.Test connection.Close(); } - [Test] + [Test, Timeout(20_000)] public void TestConnectionCanPurgeTempDestinations() { Connection connection = GetNewConnection(); @@ -534,4 +534,3 @@ namespace Apache.NMS.ActiveMQ.Test } } } - diff --git a/test/Threads/CompositeTaskRunnerTest.cs b/test/Threads/CompositeTaskRunnerTest.cs index 1f42934..858c862 100644 --- a/test/Threads/CompositeTaskRunnerTest.cs +++ b/test/Threads/CompositeTaskRunnerTest.cs @@ -58,7 +58,7 @@ namespace Apache.NMS.ActiveMQ.Test.Threads } } - [Test] + [Test, Timeout(20_000)] public void TestCompositeTaskRunner() { @@ -91,7 +91,7 @@ namespace Apache.NMS.ActiveMQ.Test.Threads runner.RemoveTask(task2); } - [Test] + [Test, Timeout(20_000)] public void CompositeTaskRunnerDoesntHoldLockWhileCallingIterate() { object lockObj = new object(); diff --git a/test/Threads/DedicatedTaskRunnerTest.cs b/test/Threads/DedicatedTaskRunnerTest.cs index 0752932..c88244a 100644 --- a/test/Threads/DedicatedTaskRunnerTest.cs +++ b/test/Threads/DedicatedTaskRunnerTest.cs @@ -68,7 +68,7 @@ namespace Apache.NMS.ActiveMQ.Test.Threads } } - [Test] + [Test, Timeout(20_000)] public void TestSimple() { try diff --git a/test/Threads/SchedulerTest.cs b/test/Threads/SchedulerTest.cs index 9729203..53c9a70 100644 --- a/test/Threads/SchedulerTest.cs +++ b/test/Threads/SchedulerTest.cs @@ -39,7 +39,7 @@ namespace Apache.NMS.ActiveMQ.Test counter = 0; } - [Test] + [Test, Timeout(20_000)] public void TestConstructor() { Scheduler scheduler = new Scheduler("TestConstructor"); @@ -50,7 +50,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsFalse(scheduler.Started); } - [Test] + [Test, Timeout(20_000)] public void TestNullWaitCallbackThrows() { Scheduler scheduler = new Scheduler("TestNullWaitCallbackThrows"); @@ -93,7 +93,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestExecutePeriodically() { { @@ -125,7 +125,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestExecuteAfterDelay() { Scheduler scheduler = new Scheduler("TestExecuteAfterDelay"); @@ -140,7 +140,7 @@ namespace Apache.NMS.ActiveMQ.Test scheduler.Stop(); } - [Test] + [Test, Timeout(20_000)] public void TestExecuteAfterDelayNoDelay() { Scheduler scheduler = new Scheduler("TestExecuteAfterDelay"); @@ -153,7 +153,7 @@ namespace Apache.NMS.ActiveMQ.Test scheduler.Stop(); } - [Test] + [Test, Timeout(20_000)] public void TestCancel() { Scheduler scheduler = new Scheduler("TestCancel"); @@ -167,7 +167,7 @@ namespace Apache.NMS.ActiveMQ.Test scheduler.Stop(); } - [Test] + [Test, Timeout(20_000)] public void TestStop() { Scheduler scheduler = new Scheduler("TestStop"); diff --git a/test/Threads/ThreadPoolExecutorTest.cs b/test/Threads/ThreadPoolExecutorTest.cs index 0ac17f4..035d19f 100644 --- a/test/Threads/ThreadPoolExecutorTest.cs +++ b/test/Threads/ThreadPoolExecutorTest.cs @@ -112,7 +112,7 @@ namespace Apache.NMS.ActiveMQ.Test this.count = 0; } - [Test] + [Test, Timeout(20_000)] public void TestConstructor() { ThreadPoolExecutor executor = new ThreadPoolExecutor(); @@ -122,7 +122,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue(executor.IsShutdown); } - [Test] + [Test, Timeout(20_000)] public void TestSingleTaskExecuted() { ThreadPoolExecutor executor = new ThreadPoolExecutor(); @@ -138,7 +138,7 @@ namespace Apache.NMS.ActiveMQ.Test JoinPool(executor); } - [Test] + [Test, Timeout(20_000)] public void TestTaskParamIsPropagated() { ThreadPoolExecutor executor = new ThreadPoolExecutor(); @@ -154,7 +154,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue(executor.IsShutdown); } - [Test] + [Test, Timeout(20_000)] public void TestAllTasksComplete() { ThreadPoolExecutor executor = new ThreadPoolExecutor(); @@ -173,7 +173,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue(executor.IsShutdown); } - [Test] + [Test, Timeout(20_000)] public void TestAllTasksCompleteAfterException() { ThreadPoolExecutor executor = new ThreadPoolExecutor(); @@ -194,7 +194,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue(executor.IsShutdown); } - [Test] + [Test, Timeout(20_000)] public void TestThatShutdownDoesntPurgeTasks() { ThreadPoolExecutor executor = new ThreadPoolExecutor(); @@ -218,7 +218,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue(executor.IsShutdown); } - [Test] + [Test, Timeout(20_000)] public void TestIsTerminated() { ThreadPoolExecutor executor = new ThreadPoolExecutor(); @@ -233,7 +233,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue(executor.IsTerminated); } - [Test] + [Test, Timeout(20_000)] public void TestAwaitTermination() { ThreadPoolExecutor executor = new ThreadPoolExecutor(); diff --git a/test/Threads/TimerExTest.cs b/test/Threads/TimerExTest.cs index 7e9fb4b..836a6fc 100644 --- a/test/Threads/TimerExTest.cs +++ b/test/Threads/TimerExTest.cs @@ -192,7 +192,7 @@ namespace Apache.NMS.ActiveMQ.Test this.data = new TestData(); } - [Test] + [Test, Timeout(20_000)] public void TestConstructorBool() { TimerEx t = null; @@ -215,7 +215,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestConstructor() { TimerEx t = null; @@ -238,7 +238,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestConstructorStringBool() { TimerEx t = null; @@ -261,7 +261,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestConstructorString() { TimerEx t = null; @@ -284,7 +284,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestConstructorThrowsException() { try @@ -308,7 +308,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestCancel() { TimerEx t = null; @@ -387,7 +387,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestPurge() { TimerEx t = null; @@ -427,7 +427,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleWaitCallbackDateTime() { TimerEx t = null; @@ -520,7 +520,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleWaitCallbackWithDelay() { TimerEx t = null; @@ -544,7 +544,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleWaitCallbackWithDelayAsTimeSpan() { TimerEx t = null; @@ -568,7 +568,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleWaitCallbackWithDelayAndPeriod() { TimerEx t = null; @@ -593,7 +593,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleWaitCallbackWithDelayAndPeriodTimeSpan() { TimerEx t = null; @@ -618,7 +618,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleWaitCallbackWithDateTimePeriod() { TimerEx t = null; @@ -644,7 +644,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleWaitCallbackWithDateTimePeriodTimeSpan() { TimerEx t = null; @@ -670,7 +670,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleAtFixedRateWaitCallbackWithDelayPeriod() { TimerEx t = null; @@ -695,7 +695,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleAtFixedRateWaitCallbackWithDelayPeriodTimeSpan() { TimerEx t = null; @@ -721,7 +721,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleAtFixedRateWaitCallbackWithDateTimePeriod() { TimerEx t = null; @@ -747,7 +747,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleAtFixedRateWaitCallbackWithDateTimePeriodTimeSpan() { TimerEx t = null; @@ -773,7 +773,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleTimerTaskDateTime() { TimerEx t = null; @@ -873,7 +873,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleTimerTaskDelay() { TimerEx t = null; @@ -1000,7 +1000,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleTimerTaskDelayTimeSpan() { TimerEx t = null; @@ -1127,7 +1127,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleTimerTaskDelayPeriod() { TimerEx t = null; @@ -1286,7 +1286,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleTimerTaskDateTimePeriod() { TimerEx t = null; @@ -1403,7 +1403,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleAtFixedRateTimerTaskDelayPeriod() { TimerEx t = null; @@ -1489,7 +1489,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestScheduleAtFixedRateTimerTaskDateTimePeriod() { TimerEx t = null; diff --git a/test/Transport/Inactivity/InactivityMonitorTest.cs b/test/Transport/Inactivity/InactivityMonitorTest.cs index ba5fb4f..12febf2 100644 --- a/test/Transport/Inactivity/InactivityMonitorTest.cs +++ b/test/Transport/Inactivity/InactivityMonitorTest.cs @@ -72,7 +72,7 @@ namespace Apache.NMS.ActiveMQ.Test this.asyncErrorLatch = new CountDownLatch(1); } - [Test] + [Test, Timeout(20_000)] public void TestCreate() { InactivityMonitor monitor = new InactivityMonitor( this.transport ); @@ -84,7 +84,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( monitor.IsDisposed == false ); } - [Test] + [Test, Timeout(20_000)] public void TestReadTimeout() { InactivityMonitor monitor = new InactivityMonitor( this.transport ); @@ -104,7 +104,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( this.exceptions.Count > 0 ); } - [Test] + [Test, Timeout(20_000)] public void TestWriteMessageFail() { this.transport.FailOnKeepAliveInfoSends = true ; @@ -134,7 +134,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestNonFailureSendCase() { InactivityMonitor monitor = new InactivityMonitor( this.transport ); diff --git a/test/Transport/Tcp/TcpFaultyTransportTest.cs b/test/Transport/Tcp/TcpFaultyTransportTest.cs index 3c4f46f..b18085d 100644 --- a/test/Transport/Tcp/TcpFaultyTransportTest.cs +++ b/test/Transport/Tcp/TcpFaultyTransportTest.cs @@ -63,7 +63,7 @@ namespace Apache.NMS.ActiveMQ.Test } - [Test, Sequential] + [Test, Sequential, Timeout(20_000)] public void TestConnectUsingBasicTransport( [Values("tcpfaulty://${activemqhost}:61616", "activemq:tcpfaulty://${activemqhost}:61616")] string connectionURI) diff --git a/test/Transport/failover/FailoverTransactionTest.cs b/test/Transport/failover/FailoverTransactionTest.cs index 0f0f6c1..f26bef0 100644 --- a/test/Transport/failover/FailoverTransactionTest.cs +++ b/test/Transport/failover/FailoverTransactionTest.cs @@ -47,7 +47,7 @@ namespace Apache.NMS.ActiveMQ.Test this.commitFailed = false; } - [Test][Timeout(50_000)] + [Test, Timeout(20_000)] public void FailoverAfterCommitSentTest() { string uri = "failover:(tcpfaulty://${activemqhost}:61616?transport.useLogging=true)"; @@ -117,7 +117,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue(this.resumed); } - [Test][Timeout(50_000)] + [Test, Timeout(20_000)] public void FailoverBeforeCommitSentTest() { string uri = "failover:(tcpfaulty://${activemqhost}:61616?transport.useLogging=true)"; @@ -182,7 +182,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue(this.resumed); } - [Test][Timeout(50_000)] + [Test, Timeout(20_000)] public void FailoverWithShortLivedProducerTest() { string uri = "failover:(tcpfaulty://${activemqhost}:61616?transport.useLogging=true)"; @@ -239,7 +239,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue(this.resumed); } - [Test][Timeout(50_000)] + [Test, Timeout(20_000)] public void TestMessageDeliveredAfterCommitFailsAndRollback() { string uri = "failover:(tcpfaulty://${activemqhost}:61616?transport.useLogging=true)"; @@ -374,4 +374,3 @@ namespace Apache.NMS.ActiveMQ.Test } } } - diff --git a/test/Transport/failover/FailoverTransportTest.cs b/test/Transport/failover/FailoverTransportTest.cs index 4bdfb51..6233f55 100644 --- a/test/Transport/failover/FailoverTransportTest.cs +++ b/test/Transport/failover/FailoverTransportTest.cs @@ -112,7 +112,7 @@ namespace Apache.NMS.ActiveMQ.Test this.resumed = false; } - [Test] + [Test, Timeout(20_000)] public void FailoverTransportCreateTest() { Uri uri = new Uri("failover:(mock://localhost:61616)?transport.randomize=false"); @@ -138,7 +138,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void FailoverTransportWithBackupsTest() { Uri uri = new Uri("failover:(mock://localhost:61616,mock://localhost:61618)?transport.randomize=false&transport.backup=true"); @@ -162,7 +162,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue(failover.IsConnected); } } - [Test] + [Test, Timeout(20_000)] public void FailoverTransportWithNestedParametersTest() { Uri uri = new Uri("failover:(mock://localhost:61616)?transport.randomize=false&transport.backup=true&nested.transport.failOnSendMessage=true&nested.transport.numSentMessagesBeforeFail=20"); @@ -191,7 +191,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.AreEqual(20,mock.NumSentMessagesBeforeFail); } } - [Test] + [Test, Timeout(20_000)] public void FailoverTransportCreateFailOnCreateTest() { Uri uri = new Uri("failover:(mock://localhost:61616?transport.failOnCreate=true)?" + @@ -247,7 +247,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void FailoverTransportFailOnSendMessageTest() { Uri uri = new Uri("failover:(mock://localhost:61616?transport.failOnCreate=true)?" + @@ -278,7 +278,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void FailoverTransportFailingBackupsTest() { Uri uri = new Uri( @@ -305,7 +305,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void FailoverTransportSendOnewayMessageTest() { int numMessages = 1000; @@ -349,7 +349,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public async Task FailoverTransportSendRequestTest() { Uri uri = new Uri("failover:(mock://localhost:61616)?transport.randomize=false"); @@ -393,7 +393,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void FailoverTransportSendOnewayFailTest() { Uri uri = new Uri( @@ -443,7 +443,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void FailoverTransportSendOnewayTimeoutTest() { Uri uri = new Uri( @@ -470,7 +470,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void FailoverTransportSendRequestFailTest() { Uri uri = new Uri( @@ -515,7 +515,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestFailoverTransportConnectionControlHandling() { Uri uri = new Uri("failover:(mock://localhost:61613)?transport.randomize=false"); @@ -588,7 +588,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestPriorityBackupConfig() { Uri uri = new Uri("failover:(mock://localhost:61616,mock://localhost:61618)"+ @@ -626,7 +626,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestPriorityBackupConfigPriorityURIsList() { Uri uri = new Uri("failover:(mock://localhost:61616,mock://localhost:61618)" + @@ -669,7 +669,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public async Task OpenWireCommandsTest() { Uri uri = new Uri("failover:(mock://localhost:61616)?transport.randomize=false"); @@ -790,7 +790,7 @@ namespace Apache.NMS.ActiveMQ.Test transport.Oneway(new RemoveInfo() { ObjectId = producer.ProducerId }); } - [Test] + [Test, Timeout(20_000)] public void FailoverTransportFailOnProcessingReceivedMessageTest() { string uri = "failover:(tcp://${activemqhost}:61616)"; @@ -822,7 +822,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue(this.resumed); } - [Test] + [Test, Timeout(20_000)] public void FailStartupMaxReconnectAttempts() { // Connect to valid machine, but on invalid port that doesn't have a broker listening. diff --git a/test/Util/FifoMessageDispatchChannelTest.cs b/test/Util/FifoMessageDispatchChannelTest.cs index b2f70a6..e8868ef 100644 --- a/test/Util/FifoMessageDispatchChannelTest.cs +++ b/test/Util/FifoMessageDispatchChannelTest.cs @@ -26,7 +26,7 @@ namespace Apache.NMS.ActiveMQ.Test [TestFixture] public class FifoMessageDispatchChannelTest { - [Test] + [Test, Timeout(20_000)] public void TestCtor() { FifoMessageDispatchChannel channel = new FifoMessageDispatchChannel(); @@ -36,7 +36,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Closed == false ); } - [Test] + [Test, Timeout(20_000)] public void TestStart() { FifoMessageDispatchChannel channel = new FifoMessageDispatchChannel(); @@ -44,7 +44,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Running == true ); } - [Test] + [Test, Timeout(20_000)] public void TestStop() { FifoMessageDispatchChannel channel = new FifoMessageDispatchChannel(); @@ -54,7 +54,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Running == false ); } - [Test] + [Test, Timeout(20_000)] public void TestClose() { FifoMessageDispatchChannel channel = new FifoMessageDispatchChannel(); @@ -69,7 +69,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Closed == true ); } - [Test] + [Test, Timeout(20_000)] public void TestEnqueue() { FifoMessageDispatchChannel channel = new FifoMessageDispatchChannel(); @@ -90,7 +90,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Count == 2 ); } - [Test] + [Test, Timeout(20_000)] public void TestEnqueueFront() { FifoMessageDispatchChannel channel = new FifoMessageDispatchChannel(); @@ -116,7 +116,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.DequeueNoWait() == dispatch1 ); } - [Test] + [Test, Timeout(20_000)] public void TestPeek() { FifoMessageDispatchChannel channel = new FifoMessageDispatchChannel(); @@ -146,7 +146,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.DequeueNoWait() == dispatch1 ); } - [Test] + [Test, Timeout(20_000)] public void TestDequeueNoWait() { FifoMessageDispatchChannel channel = new FifoMessageDispatchChannel(); @@ -176,7 +176,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Empty == true ); } - [Test] + [Test, Timeout(20_000)] public void TestDequeue() { FifoMessageDispatchChannel channel = new FifoMessageDispatchChannel(); @@ -210,7 +210,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Empty == true ); } - [Test] + [Test, Timeout(20_000)] public void TestRemoveAll() { FifoMessageDispatchChannel channel = new FifoMessageDispatchChannel(); diff --git a/test/Util/SimplePriorityMessageDispatchChannelTest.cs b/test/Util/SimplePriorityMessageDispatchChannelTest.cs index bef7ab6..bbac1bd 100644 --- a/test/Util/SimplePriorityMessageDispatchChannelTest.cs +++ b/test/Util/SimplePriorityMessageDispatchChannelTest.cs @@ -26,7 +26,7 @@ namespace Apache.NMS.ActiveMQ.Test [TestFixture] public class SimplePriorityMessageDispatchChannelTest { - [Test] + [Test, Timeout(20_000)] public void TestCtor() { SimplePriorityMessageDispatchChannel channel = new SimplePriorityMessageDispatchChannel(); @@ -36,7 +36,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Closed == false ); } - [Test] + [Test, Timeout(20_000)] public void TestStart() { SimplePriorityMessageDispatchChannel channel = new SimplePriorityMessageDispatchChannel(); @@ -44,7 +44,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Running == true ); } - [Test] + [Test, Timeout(20_000)] public void TestStop() { SimplePriorityMessageDispatchChannel channel = new SimplePriorityMessageDispatchChannel(); @@ -54,7 +54,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Running == false ); } - [Test] + [Test, Timeout(20_000)] public void TestClose() { SimplePriorityMessageDispatchChannel channel = new SimplePriorityMessageDispatchChannel(); @@ -69,7 +69,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Closed == true ); } - [Test] + [Test, Timeout(20_000)] public void TestEnqueue() { SimplePriorityMessageDispatchChannel channel = new SimplePriorityMessageDispatchChannel(); @@ -90,7 +90,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Count == 2 ); } - [Test] + [Test, Timeout(20_000)] public void TestEnqueueFront() { SimplePriorityMessageDispatchChannel channel = new SimplePriorityMessageDispatchChannel(); @@ -116,7 +116,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.DequeueNoWait() == dispatch1 ); } - [Test] + [Test, Timeout(20_000)] public void TestPeek() { SimplePriorityMessageDispatchChannel channel = new SimplePriorityMessageDispatchChannel(); @@ -155,7 +155,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.DequeueNoWait() == dispatch2 ); } - [Test] + [Test, Timeout(20_000)] public void TestDequeueNoWait() { SimplePriorityMessageDispatchChannel channel = new SimplePriorityMessageDispatchChannel(); @@ -197,7 +197,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Empty == true ); } - [Test] + [Test, Timeout(20_000)] public void TestDequeue() { SimplePriorityMessageDispatchChannel channel = new SimplePriorityMessageDispatchChannel(); @@ -243,7 +243,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsTrue( channel.Empty == true ); } - [Test] + [Test, Timeout(20_000)] public void TestRemoveAll() { SimplePriorityMessageDispatchChannel channel = new SimplePriorityMessageDispatchChannel(); diff --git a/test/VirtualTopicTest.cs b/test/VirtualTopicTest.cs index 93f668e..b6dca27 100644 --- a/test/VirtualTopicTest.cs +++ b/test/VirtualTopicTest.cs @@ -32,7 +32,7 @@ namespace Apache.NMS.ActiveMQ.Test protected const int totalMsgs = 5; - [Test] + [Test, Timeout(20_000)] public void SendReceiveVirtualTopicMessage( [Values(AcknowledgementMode.AutoAcknowledge, AcknowledgementMode.ClientAcknowledge, AcknowledgementMode.DupsOkAcknowledge, AcknowledgementMode.Transactional)] @@ -104,7 +104,7 @@ namespace Apache.NMS.ActiveMQ.Test protected int receivedA; protected int receivedB; - [Test] + [Test, Timeout(20_000)] // Do not use listeners with transactional processing. public void AsyncSendReceiveVirtualTopicMessage( [Values(AcknowledgementMode.AutoAcknowledge, AcknowledgementMode.ClientAcknowledge, AcknowledgementMode.DupsOkAcknowledge)] diff --git a/test/ZeroPrefetchConsumerTest.cs b/test/ZeroPrefetchConsumerTest.cs index 482557e..75509bc 100644 --- a/test/ZeroPrefetchConsumerTest.cs +++ b/test/ZeroPrefetchConsumerTest.cs @@ -32,7 +32,7 @@ namespace Apache.NMS.ActiveMQ.Test { } - [Test] + [Test, Timeout(20_000)] public void TestCannotUseMessageListener() { ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge); @@ -48,7 +48,7 @@ namespace Apache.NMS.ActiveMQ.Test } } - [Test] + [Test, Timeout(20_000)] public void TestPullConsumerWorks() { ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge); @@ -67,7 +67,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsNull(answer, "Should have not received a message!"); } - [Test] + [Test, Timeout(20_000)] public void TestIdleConsumer( [Values(AcknowledgementMode.AutoAcknowledge, AcknowledgementMode.Transactional)] AcknowledgementMode ackMode) @@ -105,7 +105,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsNull(answer, "Should have not received a message!"); } - [Test] + [Test, Timeout(20_000)] public void TestRecvRecvCommit( [Values(AcknowledgementMode.AutoAcknowledge, AcknowledgementMode.Transactional)] AcknowledgementMode ackMode) @@ -133,7 +133,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsNull(answer, "Should have not received a message!"); } - [Test] + [Test, Timeout(20_000)] public void TestTwoConsumers() { ISession session = connection.CreateSession(AcknowledgementMode.AutoAcknowledge); @@ -154,7 +154,7 @@ namespace Apache.NMS.ActiveMQ.Test Assert.IsNull(answer, "Should have not received a message!"); } - [Test] + [Test, Timeout(20_000)] public void TestConsumerReceivePrefetchZeroRedeliveryZero() { const string QUEUE_NAME = "TEST.TestConsumerReceivePrefetchZeroRedeliveryZero"; --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information, visit: https://activemq.apache.org/contact
