You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by aa...@apache.org on 2019/08/24 10:31:27 UTC

[pulsar] 03/03: Add Timeout to tests

This is an automated email from the ASF dual-hosted git repository.

aahmed pushed a commit to branch github_exp2
in repository https://gitbox.apache.org/repos/asf/pulsar.git

commit 93ccd0533089af7cbfc727349136275d036634ad
Author: Ali Ahmed <al...@gmail.com>
AuthorDate: Fri Aug 23 17:50:11 2019 -0700

    Add Timeout to tests
---
 .../org/apache/pulsar/PulsarBrokerStarterTest.java | 18 ++---
 .../apache/pulsar/broker/SLAMonitoringTest.java    | 12 ++--
 .../broker/admin/AdminApiGetLastMessageIdTest.java |  8 +--
 .../pulsar/broker/admin/AdminApiOffloadTest.java   |  8 +--
 .../broker/admin/AdminApiSchemaAutoUpdateTest.java | 20 +++---
 .../pulsar/broker/admin/AdminApiSchemaTest.java    | 10 +--
 .../admin/AdminApiSchemaValidationEnforced.java    | 14 ++--
 .../apache/pulsar/broker/admin/AdminApiTest.java   | 74 ++++++++++----------
 .../apache/pulsar/broker/admin/AdminApiTest2.java  | 42 ++++++------
 .../pulsar/broker/admin/AdminApiTlsAuthTest.java   | 30 ++++-----
 .../pulsar/broker/admin/AdminResourceTest.java     |  4 +-
 .../org/apache/pulsar/broker/admin/AdminTest.java  | 22 +++---
 .../broker/admin/BrokerAdminClientTlsAuthTest.java |  8 +--
 .../broker/admin/CreateSubscriptionTest.java       | 10 +--
 .../broker/admin/IncrementPartitionsTest.java      |  8 +--
 .../apache/pulsar/broker/admin/NamespacesTest.java | 52 +++++++--------
 .../pulsar/broker/admin/PersistentTopicsTest.java  | 18 ++---
 .../pulsar/broker/admin/v1/V1_AdminApiTest.java    | 74 ++++++++++----------
 .../pulsar/broker/admin/v1/V1_AdminApiTest2.java   | 33 +++++----
 .../pulsar/broker/auth/AuthorizationTest.java      |  8 +--
 .../broker/auth/MockedPulsarServiceBaseTest.java   |  6 ++
 .../broker/cache/ResourceQuotaCacheTest.java       | 14 ++--
 .../delayed/InMemoryDeliveryTrackerTest.java       |  4 +-
 .../AntiAffinityNamespaceGroupTest.java            | 16 ++---
 .../loadbalance/BrokerVersionFilterTest.java       |  2 +-
 .../broker/loadbalance/LoadBalancerTest.java       | 30 ++++-----
 .../broker/loadbalance/LoadReportNetworkLimit.java |  6 +-
 .../loadbalance/ModularLoadManagerImplTest.java    | 20 +++---
 .../ModularLoadManagerStrategyTest.java            |  2 +-
 .../loadbalance/SimpleLoadManagerImplTest.java     | 26 ++++----
 .../loadbalance/impl/OverloadShedderTest.java      | 12 ++--
 .../broker/lookup/http/HttpTopicLookupv2Test.java  | 10 +--
 .../namespace/NamespaceCreateBundlesTest.java      |  6 +-
 .../broker/namespace/NamespaceServiceTest.java     | 20 +++---
 .../broker/namespace/NamespaceUnloadingTest.java   |  8 +--
 .../broker/namespace/OwnershipCacheTest.java       | 18 ++---
 .../broker/service/AdvertisedAddressTest.java      |  6 +-
 .../broker/service/BacklogQuotaManagerTest.java    | 24 +++----
 .../pulsar/broker/service/BatchMessageTest.java    | 30 ++++-----
 .../broker/service/BrokerBkEnsemblesTests.java     | 10 +--
 .../broker/service/BrokerBookieIsolationTest.java  | 10 +--
 .../pulsar/broker/service/BrokerServiceTest.java   | 32 ++++-----
 .../service/BrokerServiceThrottlingTest.java       | 12 ++--
 .../broker/service/DistributedIdGeneratorTest.java | 12 ++--
 .../HashRangeStickyKeyConsumerSelectorTest.java    |  8 +--
 .../pulsar/broker/service/MaxMessageSizeTest.java  |  6 +-
 .../broker/service/MessageIdSerialization.java     | 10 +--
 .../broker/service/NonPersistentTopicE2ETest.java  |  8 +--
 .../pulsar/broker/service/PartitionKeyTest.java    |  6 +-
 .../pulsar/broker/service/PeerReplicatorTest.java  |  6 +-
 .../PersistentDispatcherFailoverConsumerTest.java  | 16 ++---
 .../broker/service/PersistentFailoverE2ETest.java  | 10 +--
 .../service/PersistentMessageFinderTest.java       |  4 +-
 .../broker/service/PersistentQueueE2ETest.java     | 12 ++--
 .../service/PersistentTopicConcurrentTest.java     | 10 +--
 .../broker/service/PersistentTopicE2ETest.java     | 72 ++++++++++----------
 .../pulsar/broker/service/PersistentTopicTest.java | 62 ++++++++---------
 .../pulsar/broker/service/RackAwareTest.java       | 12 ++--
 .../broker/service/ReplicatorGlobalNSTest.java     | 10 +--
 .../broker/service/ReplicatorRateLimiterTest.java  |  4 +-
 .../pulsar/broker/service/ReplicatorTest.java      | 22 +++---
 .../pulsar/broker/service/ReplicatorTlsTest.java   |  6 +-
 .../pulsar/broker/service/ResendRequestTest.java   |  4 +-
 .../pulsar/broker/service/ServerCnxTest.java       |  6 +-
 .../broker/service/SubscriptionSeekTest.java       | 14 ++--
 .../broker/service/TopicTerminationTest.java       | 14 ++--
 .../broker/service/persistent/ChecksumTest.java    | 10 +--
 .../service/persistent/DelayedDeliveryTest.java    | 10 +--
 .../persistent/PersistentSubscriptionTest.java     |  8 +--
 .../ReplicatedSubscriptionConfigTest.java          | 10 +--
 .../ReplicatedSubscriptionSnapshotCacheTest.java   |  4 +-
 ...ReplicatedSubscriptionsSnapshotBuilderTest.java |  8 +--
 .../schema/BaseAvroSchemaCompatibilityTest.java    | 12 ++--
 .../schema/BookkeeperSchemaStorageTest.java        |  4 +-
 .../broker/service/schema/ClientGetSchemaTest.java |  6 +-
 .../schema/JsonSchemaCompatibilityCheckTest.java   |  2 +-
 .../KeyValueSchemaCompatibilityCheckTest.java      | 62 ++++++++---------
 .../schema/PartitionedTopicsSchemaTest.java        |  6 +-
 .../broker/service/schema/SchemaServiceTest.java   | 32 ++++-----
 .../schema/validator/SchemaDataValidatorTest.java  | 12 ++--
 ...RegistryServiceWithSchemaDataValidatorTest.java | 16 ++---
 .../stats/BookieClientsStatsGeneratorTest.java     |  8 +--
 .../broker/stats/ManagedLedgerMetricsTest.java     |  6 +-
 .../pulsar/broker/stats/PrometheusMetricsTest.java |  8 +--
 .../prometheus/AggregatedNamespaceStatsTest.java   |  2 +-
 .../buffer/InMemTransactionBufferReaderTest.java   |  6 +-
 .../buffer/PersistentTransactionBufferTest.java    | 34 +++++-----
 .../transaction/buffer/TransactionBufferTest.java  | 22 +++---
 .../buffer/TransactionEntryImplTest.java           |  2 +-
 .../pulsar/broker/web/RestExceptionTest.java       |  6 +-
 .../apache/pulsar/broker/web/WebServiceTest.java   | 14 ++--
 .../zookeeper/ZooKeeperClientAspectJTest.java      |  8 +--
 .../ZooKeeperSessionExpireRecoveryTest.java        |  6 +-
 .../api/AuthenticatedProducerConsumerTest.java     | 16 ++---
 .../AuthenticationTlsHostnameVerificationTest.java |  8 +--
 .../api/AuthorizationProducerConsumerTest.java     | 12 ++--
 .../pulsar/client/api/BrokerServiceLookupTest.java | 28 ++++----
 .../org/apache/pulsar/client/api/BytesKeyTest.java |  8 +--
 .../pulsar/client/api/ClientDeduplicationTest.java |  8 +--
 .../apache/pulsar/client/api/ClientErrorsTest.java | 54 +++++++--------
 .../pulsar/client/api/ConsumerRedeliveryTest.java  |  8 +--
 .../pulsar/client/api/DeadLetterTopicTest.java     | 10 +--
 .../client/api/DispatcherBlockConsumerTest.java    | 12 ++--
 .../api/ExposeMessageRedeliveryCountTest.java      |  4 +-
 .../apache/pulsar/client/api/InterceptorsTest.java | 24 +++----
 .../client/api/KeySharedSubscriptionTest.java      | 14 ++--
 .../client/api/MessageDispatchThrottlingTest.java  | 12 ++--
 .../client/api/MutualAuthenticationTest.java       |  6 +-
 .../NonPersistentKeySharedSubscriptionTest.java    | 14 ++--
 .../pulsar/client/api/NonPersistentTopicTest.java  | 28 ++++----
 .../api/PartitionedProducerConsumerTest.java       |  8 +--
 .../pulsar/client/api/ProducerConsumerBase.java    |  2 +-
 .../pulsar/client/api/ServiceUrlProviderTest.java  |  8 +--
 .../client/api/SimpleProducerConsumerStatTest.java | 14 ++--
 .../client/api/SimpleProducerConsumerTest.java     | 78 +++++++++++-----------
 .../apache/pulsar/client/api/SimpleSchemaTest.java | 30 ++++-----
 .../api/SimpleTypedProducerConsumerTest.java       | 26 ++++----
 .../SubscriptionMessageDispatchThrottlingTest.java |  2 +-
 .../pulsar/client/api/TlsHostVerification.java     |  4 +-
 .../pulsar/client/api/TlsProducerConsumerBase.java |  4 +-
 .../apache/pulsar/client/api/TopicReaderTest.java  | 36 +++++-----
 .../client/api/v1/V1_ProducerConsumerBase.java     |  2 +-
 .../client/api/v1/V1_ProducerConsumerTest.java     | 56 ++++++++--------
 .../impl/BatchMessageIdImplSerializationTest.java  | 10 +--
 .../client/impl/BrokerClientIntegrationTest.java   | 12 ++--
 .../client/impl/CompactedOutBatchMessageTest.java  |  7 +-
 .../pulsar/client/impl/ConnectionPoolTest.java     |  8 +--
 .../client/impl/ConsumeBaseExceptionTest.java      |  8 +--
 .../client/impl/ConsumerConfigurationTest.java     | 12 ++--
 .../client/impl/ConsumerDedupPermitsUpdate.java    |  5 +-
 .../client/impl/ConsumerUnsubscribeTest.java       |  6 +-
 .../apache/pulsar/client/impl/MessageIdTest.java   | 10 +--
 .../pulsar/client/impl/MessageParserTest.java      |  8 +--
 .../pulsar/client/impl/MessageRedeliveryTest.java  |  4 +-
 .../pulsar/client/impl/NegativeAcksTest.java       |  6 +-
 .../client/impl/PatternTopicsConsumerImplTest.java |  4 +-
 .../PerMessageUnAcknowledgedRedeliveryTest.java    |  4 +-
 .../pulsar/client/impl/RawMessageSerDeserTest.java |  2 +-
 .../apache/pulsar/client/impl/RawReaderTest.java   | 20 +++---
 .../org/apache/pulsar/client/impl/ReaderTest.java  | 10 +--
 .../pulsar/client/impl/SchemaDeleteTest.java       |  6 +-
 .../client/impl/SequenceIdWithErrorTest.java       |  6 +-
 .../pulsar/client/impl/TopicFromMessageTest.java   |  4 +-
 .../pulsar/client/impl/TopicsConsumerImplTest.java |  6 +-
 .../impl/UnAcknowledgedMessagesTimeoutTest.java    |  8 +--
 .../pulsar/client/impl/ZeroQueueSizeTest.java      | 22 +++---
 .../pulsar/common/naming/NamespaceBundleTest.java  | 12 ++--
 .../pulsar/common/naming/NamespaceBundlesTest.java |  8 +--
 .../common/naming/ServiceConfigurationTest.java    |  8 +--
 .../pulsar/compaction/CompactedTopicTest.java      |  8 +--
 .../apache/pulsar/compaction/CompactionTest.java   | 46 ++++++-------
 .../apache/pulsar/compaction/CompactorTest.java    | 12 ++--
 .../service/web/DiscoveryServiceWebTest.java       |  6 +-
 .../worker/PulsarFunctionE2ESecurityTest.java      | 19 ++++--
 .../worker/PulsarFunctionLocalRunTest.java         |  6 +-
 .../worker/PulsarFunctionPublishTest.java          | 11 ++-
 .../functions/worker/PulsarFunctionStateTest.java  | 11 ++-
 .../worker/PulsarWorkerAssignmentTest.java         | 12 ++--
 .../apache/pulsar/io/PulsarFunctionAdminTest.java  |  4 +-
 .../apache/pulsar/io/PulsarFunctionE2ETest.java    | 15 +++--
 .../apache/pulsar/io/PulsarFunctionTlsTest.java    |  6 +-
 .../stats/client/PulsarBrokerStatsClientTest.java  | 10 +--
 .../pulsar/utils/SimpleTextOutputStreamTest.java   | 10 +--
 .../apache/pulsar/utils/StatsOutputStreamTest.java | 14 ++--
 .../websocket/proxy/ProxyAuthenticationTest.java   | 12 ++--
 .../websocket/proxy/ProxyAuthorizationTest.java    |  6 +-
 .../websocket/proxy/ProxyConfigurationTest.java    |  4 +-
 .../websocket/proxy/ProxyPublishConsumeTest.java   |  6 +-
 .../proxy/ProxyPublishConsumeTlsTest.java          |  9 ++-
 .../proxy/ProxyPublishConsumeWithoutZKTest.java    |  6 +-
 .../proxy/v1/V1_ProxyAuthenticationTest.java       | 12 ++--
 .../kafka/clients/consumer/ConsumerConnector.java  |  2 +-
 .../pulsar/websocket/service/ProxyServer.java      | 21 +++---
 173 files changed, 1251 insertions(+), 1224 deletions(-)

diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/PulsarBrokerStarterTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/PulsarBrokerStarterTest.java
index ba4b212..7c91a8d 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/PulsarBrokerStarterTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/PulsarBrokerStarterTest.java
@@ -89,7 +89,7 @@ public class PulsarBrokerStarterTest {
      * method returns a non-null {@link ServiceConfiguration} instance where all required settings are filled in and (2)
      * if the property variables inside the given property file are correctly referred to that returned object.
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testLoadConfig() throws SecurityException, NoSuchMethodException, IOException, IllegalArgumentException,
             IllegalAccessException, InvocationTargetException {
 
@@ -129,7 +129,7 @@ public class PulsarBrokerStarterTest {
         assertEquals(serviceConfig.getBookkeeperClientTimeoutInSeconds(), 12345);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testLoadConfigWithException() throws Exception {
 
         File testConfigFile = new File("tmp." + System.currentTimeMillis() + ".properties");
@@ -162,7 +162,7 @@ public class PulsarBrokerStarterTest {
      * method returns a non-null {@link ServiceConfiguration} instance where all required settings are filled in and (2)
      * if the property variables inside the given property file are correctly referred to that returned object.
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testLoadBalancerConfig() throws SecurityException, NoSuchMethodException, IOException,
             IllegalArgumentException, IllegalAccessException, InvocationTargetException {
 
@@ -211,7 +211,7 @@ public class PulsarBrokerStarterTest {
      * method returns a non-null {@link ServiceConfiguration} instance where all required settings are filled in and (2)
      * if the property variables inside the given property file are correctly referred to that returned object.
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testGlobalZooKeeperConfig() throws SecurityException, NoSuchMethodException, IOException,
             IllegalArgumentException, IllegalAccessException, InvocationTargetException {
 
@@ -270,7 +270,7 @@ public class PulsarBrokerStarterTest {
     /**
      * Verifies that the main throws {@link FileNotFoundException} when no argument is given.
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMainWithNoArgument() throws Exception {
         try {
             PulsarBrokerStarter.main(new String[0]);
@@ -284,7 +284,7 @@ public class PulsarBrokerStarterTest {
      * Verifies that the main throws {@link IllegalArgumentException}
      * when no config file for bookie and bookie auto recovery is given.
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMainRunBookieAndAutoRecoveryNoConfig() throws Exception {
         try {
             File testConfigFile = createValidBrokerConfigFile();
@@ -302,7 +302,7 @@ public class PulsarBrokerStarterTest {
      * Verifies that the main throws {@link IllegalArgumentException}
      * when no config file for bookie auto recovery is given.
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMainRunBookieRecoveryNoConfig() throws Exception {
         try {
             File testConfigFile = createValidBrokerConfigFile();
@@ -318,7 +318,7 @@ public class PulsarBrokerStarterTest {
     /**
      * Verifies that the main throws {@link IllegalArgumentException} when no config file for bookie is given.
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMainRunBookieNoConfig() throws Exception {
         try {
             File testConfigFile = createValidBrokerConfigFile();
@@ -334,7 +334,7 @@ public class PulsarBrokerStarterTest {
     /**
      * Verifies that the main throws {@link IllegalArgumentException} when no config file for bookie .
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMainEnableRunBookieThroughBrokerConfig() throws Exception {
         try {
             File testConfigFile = createValidBrokerConfigFile();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/SLAMonitoringTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/SLAMonitoringTest.java
index 6b56a29..5f1d9e1 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/SLAMonitoringTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/SLAMonitoringTest.java
@@ -69,7 +69,7 @@ public class SLAMonitoringTest {
     private PulsarAdmin[] pulsarAdmins = new PulsarAdmin[BROKER_COUNT];
     private ServiceConfiguration[] configurations = new ServiceConfiguration[BROKER_COUNT];
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     void setup() throws Exception {
         log.info("---- Initializing SLAMonitoringTest -----");
         // Start local bookkeeper ensemble
@@ -124,7 +124,7 @@ public class SLAMonitoringTest {
         pulsarAdmin.tenants().createTenant("sla-monitor", adminConfig);
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     void shutdown() throws Exception {
         log.info("--- Shutting down ---");
         executor.shutdown();
@@ -137,7 +137,7 @@ public class SLAMonitoringTest {
         bkEnsemble.stop();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOwnershipAfterSetup() {
         for (int i = 0; i < BROKER_COUNT; i++) {
             try {
@@ -150,7 +150,7 @@ public class SLAMonitoringTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOwnedNamespaces() {
         testOwnershipViaAdminAfterSetup();
         try {
@@ -169,7 +169,7 @@ public class SLAMonitoringTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOwnershipViaAdminAfterSetup() {
         for (int i = 0; i < BROKER_COUNT; i++) {
             try {
@@ -186,7 +186,7 @@ public class SLAMonitoringTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUnloadIfBrokerCrashes() {
         int crashIndex = BROKER_COUNT / 2;
         log.info("Trying to close the broker at index = {}", crashIndex);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiGetLastMessageIdTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiGetLastMessageIdTest.java
index c9e14fd..c0228f6 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiGetLastMessageIdTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiGetLastMessageIdTest.java
@@ -52,7 +52,7 @@ public class AdminApiGetLastMessageIdTest extends MockedPulsarServiceBaseTest {
     protected Field uriField;
     protected UriInfo uriInfo;
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     public void initPersistentTopics() throws Exception {
         uriField = PulsarWebResource.class.getDeclaredField("uri");
         uriField.setAccessible(true);
@@ -60,7 +60,7 @@ public class AdminApiGetLastMessageIdTest extends MockedPulsarServiceBaseTest {
     }
 
     @Override
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     protected void setup() throws Exception {
         super.internalSetup();
         admin.clusters().createCluster("test", new ClusterData(brokerUrl.toString()));
@@ -85,12 +85,12 @@ public class AdminApiGetLastMessageIdTest extends MockedPulsarServiceBaseTest {
     }
 
     @Override
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetLastMessageId() throws Exception {
         try {
             persistentTopics.getLastMessageId(testTenant, testNamespace, "my-topic", true);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiOffloadTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiOffloadTest.java
index 72591c6..8c67b23 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiOffloadTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiOffloadTest.java
@@ -46,7 +46,7 @@ import org.testng.annotations.Test;
 
 public class AdminApiOffloadTest extends MockedPulsarServiceBaseTest {
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     public void setup() throws Exception {
         conf.setManagedLedgerMaxEntriesPerLedger(10);
@@ -61,7 +61,7 @@ public class AdminApiOffloadTest extends MockedPulsarServiceBaseTest {
         admin.namespaces().createNamespace("prop-xyz/ns1", Sets.newHashSet("test"));
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
@@ -125,14 +125,14 @@ public class AdminApiOffloadTest extends MockedPulsarServiceBaseTest {
     }
 
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOffloadV2() throws Exception {
         String topicName = "persistent://prop-xyz/ns1/topic1";
         String mlName = "prop-xyz/ns1/persistent/topic1";
         testOffload(topicName, mlName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOffloadV1() throws Exception {
         String topicName = "persistent://prop-xyz/test/ns1/topic2";
         String mlName = "prop-xyz/test/ns1/persistent/topic2";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaAutoUpdateTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaAutoUpdateTest.java
index 5af5c7f..40848bb 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaAutoUpdateTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaAutoUpdateTest.java
@@ -48,7 +48,7 @@ public class AdminApiSchemaAutoUpdateTest extends MockedPulsarServiceBaseTest {
 
     private static final Logger LOG = LoggerFactory.getLogger(AdminApiSchemaAutoUpdateTest.class);
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     public void setup() throws Exception {
         super.internalSetup();
@@ -63,7 +63,7 @@ public class AdminApiSchemaAutoUpdateTest extends MockedPulsarServiceBaseTest {
         admin.namespaces().createNamespace("prop-xyz/test/ns2");
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
@@ -248,49 +248,49 @@ public class AdminApiSchemaAutoUpdateTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBackwardV2() throws Exception {
         testAutoUpdateBackward("prop-xyz/ns1", "persistent://prop-xyz/ns1/backward");
         testAutoUpdateBackward("prop-xyz/ns2", "non-persistent://prop-xyz/ns2/backward-np");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testForwardV2() throws Exception {
         testAutoUpdateForward("prop-xyz/ns1", "persistent://prop-xyz/ns1/forward");
         testAutoUpdateForward("prop-xyz/ns2", "non-persistent://prop-xyz/ns2/forward-np");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testFullV2() throws Exception {
         testAutoUpdateFull("prop-xyz/ns1", "persistent://prop-xyz/ns1/full");
         testAutoUpdateFull("prop-xyz/ns2", "non-persistent://prop-xyz/ns2/full-np");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDisabledV2() throws Exception {
         testAutoUpdateDisabled("prop-xyz/ns1", "persistent://prop-xyz/ns1/disabled");
         testAutoUpdateDisabled("prop-xyz/ns2", "non-persistent://prop-xyz/ns2/disabled-np");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBackwardV1() throws Exception {
         testAutoUpdateBackward("prop-xyz/test/ns1", "persistent://prop-xyz/test/ns1/backward");
         testAutoUpdateBackward("prop-xyz/test/ns2", "non-persistent://prop-xyz/test/ns2/backward-np");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testForwardV1() throws Exception {
         testAutoUpdateForward("prop-xyz/test/ns1", "persistent://prop-xyz/test/ns1/forward");
         testAutoUpdateForward("prop-xyz/test/ns2", "non-persistent://prop-xyz/test/ns2/forward-np");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testFullV1() throws Exception {
         testAutoUpdateFull("prop-xyz/test/ns1", "persistent://prop-xyz/test/ns1/full");
         testAutoUpdateFull("prop-xyz/test/ns2", "non-persistent://prop-xyz/test/ns2/full-np");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDisabledV1() throws Exception {
         testAutoUpdateDisabled("prop-xyz/test/ns1", "persistent://prop-xyz/test/ns1/disabled");
         testAutoUpdateDisabled("prop-xyz/test/ns2", "non-persistent://prop-xyz/test/ns2/disabled-np");
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaTest.java
index ee51e1c..17bcbfd 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaTest.java
@@ -47,7 +47,7 @@ import org.testng.annotations.Test;
 @Slf4j
 public class AdminApiSchemaTest extends MockedPulsarServiceBaseTest {
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     public void setup() throws Exception {
         super.internalSetup();
@@ -59,7 +59,7 @@ public class AdminApiSchemaTest extends MockedPulsarServiceBaseTest {
         admin.namespaces().createNamespace("schematest/test", Sets.newHashSet("test"));
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
@@ -116,12 +116,12 @@ public class AdminApiSchemaTest extends MockedPulsarServiceBaseTest {
         };
     }
 
-    @Test(dataProvider = "schemas")
+    @Test(timeOut = 10000, dataProvider = "schemas")
     public void testSchemaInfoApi(Schema<?> schema) throws Exception {
         testSchemaInfoApi(schema, "schematest/test/test-" + schema.getSchemaInfo().getType());
     }
 
-    @Test(dataProvider = "schemas")
+    @Test(timeOut = 10000, dataProvider = "schemas")
     public void testSchemaInfoWithVersionApi(Schema<?> schema) throws Exception {
         testSchemaInfoWithVersionApi(schema, "schematest/test/test-" + schema.getSchemaInfo().getType());
     }
@@ -144,7 +144,7 @@ public class AdminApiSchemaTest extends MockedPulsarServiceBaseTest {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPostSchemaCompatibilityStrategy() throws PulsarAdminException {
         String namespace = "schematest/test";
         String topicName = namespace + "/testStrategyChange";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaValidationEnforced.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaValidationEnforced.java
index 970fa3f..119b3b8 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaValidationEnforced.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiSchemaValidationEnforced.java
@@ -49,7 +49,7 @@ public class AdminApiSchemaValidationEnforced extends MockedPulsarServiceBaseTes
 
     private static final Logger LOG = LoggerFactory.getLogger(AdminApiSchemaValidationEnforced.class);
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     public void setup() throws Exception {
         super.internalSetup();
@@ -59,13 +59,13 @@ public class AdminApiSchemaValidationEnforced extends MockedPulsarServiceBaseTes
         admin.tenants().createTenant("schema-validation-enforced", tenantInfo);
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDisableSchemaValidationEnforcedNoSchema() throws Exception {
         admin.namespaces().createNamespace("schema-validation-enforced/default-no-schema");
         String namespace = "schema-validation-enforced/default-no-schema";
@@ -82,7 +82,7 @@ public class AdminApiSchemaValidationEnforced extends MockedPulsarServiceBaseTes
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDisableSchemaValidationEnforcedHasSchema() throws Exception {
         admin.namespaces().createNamespace("schema-validation-enforced/default-has-schema");
         String namespace = "schema-validation-enforced/default-has-schema";
@@ -109,7 +109,7 @@ public class AdminApiSchemaValidationEnforced extends MockedPulsarServiceBaseTes
     }
 
 
-    @Test
+    @Test(timeOut = 10000)
     public void testEnableSchemaValidationEnforcedNoSchema() throws Exception {
         admin.namespaces().createNamespace("schema-validation-enforced/enable-no-schema");
         String namespace = "schema-validation-enforced/enable-no-schema";
@@ -126,7 +126,7 @@ public class AdminApiSchemaValidationEnforced extends MockedPulsarServiceBaseTes
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testEnableSchemaValidationEnforcedHasSchemaMismatch() throws Exception {
         admin.namespaces().createNamespace("schema-validation-enforced/enable-has-schema-mismatch");
         String namespace = "schema-validation-enforced/enable-has-schema-mismatch";
@@ -159,7 +159,7 @@ public class AdminApiSchemaValidationEnforced extends MockedPulsarServiceBaseTes
         assertEquals(admin.schemas().getSchemaInfo(topicName).getType(), schemaInfo.getType());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testEnableSchemaValidationEnforcedHasSchemaMatch() throws Exception {
         admin.namespaces().createNamespace("schema-validation-enforced/enable-has-schema-match");
         String namespace = "schema-validation-enforced/enable-has-schema-match";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java
index 4e03bc5..2d5f281 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest.java
@@ -138,7 +138,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
 
     private NamespaceBundleFactory bundleFactory;
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     public void setup() throws Exception {
         conf.setLoadBalancerEnabled(true);
@@ -168,7 +168,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.namespaces().createNamespace("prop-xyz/ns1", Sets.newHashSet("test"));
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         adminTls.close();
@@ -196,7 +196,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         return new Object[][] { { TopicDomain.persistent.value() }, { TopicDomain.non_persistent.value() } };
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void clusters() throws Exception {
         admin.clusters().createCluster("usw",
                 new ClusterData("http://broker.messaging.use.example.com" + ":" + BROKER_WEBSERVICE_PORT));
@@ -239,7 +239,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void clusterNamespaceIsolationPolicies() throws PulsarAdminException {
         try {
             // create
@@ -386,7 +386,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void brokers() throws Exception {
         List<String> list = admin.brokers().getActiveBrokers("test");
         Assert.assertNotNull(list);
@@ -432,7 +432,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testUpdateDynamicConfigurationWithZkWatch() throws Exception {
         final int initValue = 30000;
         pulsar.getConfiguration().setBrokerShutdownTimeoutMs(initValue);
@@ -503,7 +503,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testInvalidDynamicConfigContentInZK() throws Exception {
         final int newValue = 10;
         stopBroker();
@@ -540,7 +540,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testUpdateDynamicLocalConfiguration() throws Exception {
         // (1) try to update dynamic field
         final long initValue = 30000;
@@ -559,14 +559,14 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(pulsar.getConfiguration().getBrokerShutdownTimeoutMs(), shutdownTime);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUpdatableConfigurationName() throws Exception {
         // (1) try to update dynamic field
         final String configName = "brokerShutdownTimeoutMs";
         assertTrue(admin.brokers().getDynamicConfigurationNames().contains(configName));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetDynamicLocalConfiguration() throws Exception {
         // (1) try to update dynamic field
         final String configName = "brokerShutdownTimeoutMs";
@@ -581,7 +581,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(Long.parseLong(admin.brokers().getAllDynamicConfigurations().get(configName)), shutdownTime);
     }
 
-    @Test(enabled = true)
+    @Test(timeOut = 10000)
     public void properties() throws PulsarAdminException {
         Set<String> allowedClusters = Sets.newHashSet("test");
         TenantInfo tenantInfo = new TenantInfo(Sets.newHashSet("role1", "role2"), allowedClusters);
@@ -609,7 +609,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void namespaces() throws PulsarAdminException, PulsarServerException, Exception {
         admin.clusters().createCluster("usw", new ClusterData());
         TenantInfo tenantInfo = new TenantInfo(Sets.newHashSet("role1", "role2"),
@@ -722,7 +722,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         // otheradmin.namespaces().unload("prop-xyz/use/ns2");
     }
 
-    @Test(dataProvider = "topicName")
+    @Test(timeOut = 10000, dataProvider = "topicName")
     public void persistentTopics(String topicName) throws Exception {
         final String subName = topicName;
         assertEquals(admin.topics().getList("prop-xyz/ns1"), Lists.newArrayList());
@@ -801,7 +801,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(admin.topics().getList("prop-xyz/ns1"), Lists.newArrayList());
     }
 
-    @Test(dataProvider = "topicName")
+    @Test(timeOut = 10000, dataProvider = "topicName")
     public void partitionedTopics(String topicName) throws Exception {
         assertEquals(admin.topics().getPartitionedTopicList("prop-xyz/ns1"), Lists.newArrayList());
         final String partitionedTopicName = "persistent://prop-xyz/ns1/" + topicName;
@@ -961,7 +961,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().deletePartitionedTopic(partitionedTopicName);
     }
 
-    @Test(dataProvider = "numBundles")
+    @Test(timeOut = 10000, dataProvider = "numBundles")
     public void testDeleteNamespaceBundle(Integer numBundles) throws Exception {
         admin.namespaces().deleteNamespace("prop-xyz/ns1");
         admin.namespaces().createNamespace("prop-xyz/ns1-bundles", numBundles);
@@ -979,7 +979,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(admin.namespaces().getNamespaces("prop-xyz", "test"), Lists.newArrayList());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNamespaceSplitBundle() throws Exception {
         // Force to create a topic
         final String namespace = "prop-xyz/ns1";
@@ -1009,7 +1009,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNamespaceSplitBundleConcurrent() throws Exception {
         // Force to create a topic
         final String namespace = "prop-xyz/ns1";
@@ -1095,7 +1095,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNamespaceUnloadBundle() throws Exception {
         assertEquals(admin.topics().getList("prop-xyz/ns1"), Lists.newArrayList());
 
@@ -1154,7 +1154,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().delete("persistent://prop-xyz/ns1/ds2");
     }
 
-    @Test(dataProvider = "numBundles")
+    @Test(timeOut = 10000, dataProvider = "numBundles")
     public void testNamespaceBundleUnload(Integer numBundles) throws Exception {
         admin.namespaces().createNamespace("prop-xyz/ns1-bundles", numBundles);
         admin.namespaces().setNamespaceReplicationClusters("prop-xyz/ns1-bundles", Sets.newHashSet("test"));
@@ -1212,7 +1212,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().delete("persistent://prop-xyz/ns1-bundles/ds2");
     }
 
-    @Test(dataProvider = "bundling")
+    @Test(timeOut = 10000, dataProvider = "bundling")
     public void testClearBacklogOnNamespace(Integer numBundles) throws Exception {
         admin.namespaces().createNamespace("prop-xyz/ns1-bundles", numBundles);
         admin.namespaces().setNamespaceReplicationClusters("prop-xyz/ns1-bundles", Sets.newHashSet("test"));
@@ -1280,7 +1280,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(backlog, 0);
     }
 
-    @Test(dataProvider = "bundling")
+    @Test(timeOut = 10000, dataProvider = "bundling")
     public void testUnsubscribeOnNamespace(Integer numBundles) throws Exception {
         admin.namespaces().createNamespace("prop-xyz/ns1-bundles", numBundles);
         admin.namespaces().setNamespaceReplicationClusters("prop-xyz/ns1-bundles", Sets.newHashSet("test"));
@@ -1355,7 +1355,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void backlogQuotas() throws Exception {
         assertEquals(admin.namespaces().getBacklogQuotaMap("prop-xyz/ns1"),
                 ConfigHelper.backlogQuotaMap(conf));
@@ -1378,7 +1378,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(quotaMap.get(BacklogQuotaType.destination_storage), ConfigHelper.backlogQuota(conf));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void statsOnNonExistingTopics() throws Exception {
         try {
             admin.topics().getStats("persistent://prop-xyz/ns1/ghostTopic");
@@ -1388,7 +1388,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDeleteFailedReturnCode() throws Exception {
         String topicName = "persistent://prop-xyz/ns1/my-topic";
         Producer<byte[]> producer = pulsarClient.newProducer(Schema.BYTES)
@@ -1434,7 +1434,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         public String someNewString;
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testJacksonWithTypeDifferencies() throws Exception {
         String expectedJson = "{\"adminRoles\":[\"role1\",\"role2\"],\"allowedClusters\":[\"usw\",\"test\"]}";
         IncompatibleTenantAdmin r1 = ObjectMapperFactory.getThreadLocal().readerFor(IncompatibleTenantAdmin.class)
@@ -1444,7 +1444,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         assertNull(r1.someNewString);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBackwardCompatiblity() throws Exception {
         assertEquals(admin.tenants().getTenants(), Lists.newArrayList("prop-xyz"));
         assertEquals(admin.tenants().getTenantInfo("prop-xyz").getAdminRoles(),
@@ -1466,7 +1466,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(admin.tenants().getTenants(), Lists.newArrayList());
     }
 
-    @Test(dataProvider = "topicName")
+    @Test(timeOut = 10000, dataProvider = "topicName")
     public void persistentTopicsCursorReset(String topicName) throws Exception {
         admin.namespaces().setRetention("prop-xyz/ns1", new RetentionPolicies(10, 10));
 
@@ -1518,7 +1518,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().delete(topicName);
     }
 
-    @Test(dataProvider = "topicName")
+    @Test(timeOut = 10000, dataProvider = "topicName")
     public void persistentTopicsCursorResetAfterReset(String topicName) throws Exception {
         admin.namespaces().setRetention("prop-xyz/ns1", new RetentionPolicies(10, 10));
         assertEquals(admin.topics().getList("prop-xyz/ns1"), Lists.newArrayList());
@@ -1589,7 +1589,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().delete(topicName);
     }
 
-    @Test(dataProvider = "topicName")
+    @Test(timeOut = 10000, dataProvider = "topicName")
     public void partitionedTopicsCursorReset(String topicName) throws Exception {
         admin.namespaces().setRetention("prop-xyz/ns1", new RetentionPolicies(10, 10));
         topicName = "persistent://prop-xyz/ns1/" + topicName;
@@ -1636,7 +1636,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().deletePartitionedTopic(topicName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void persistentTopicsInvalidCursorReset() throws Exception {
         admin.namespaces().setRetention("prop-xyz/ns1", new RetentionPolicies(10, 10));
 
@@ -1684,7 +1684,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().delete(topicName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testObjectWithUnknowProperties() {
 
         class CustomTenantAdmin extends TenantInfo {
@@ -1716,7 +1716,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testPersistentTopicsExpireMessages() throws Exception {
 
         // Force to create a topic
@@ -1771,7 +1771,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testPersistentTopicExpireMessageOnParitionTopic() throws Exception {
 
         admin.topics().createPartitionedTopic("persistent://prop-xyz/ns1/ds1", 4);
@@ -1828,7 +1828,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
      * @param topicName
      * @throws Exception
      */
-    @Test(dataProvider = "topicName")
+    @Test(timeOut = 10000, dataProvider = "topicName")
     public void testPulsarAdminForUriAndUrlEncoding(String topicName) throws Exception {
         final String ns1 = "prop-xyz/ns1";
         final String topic1 = "persistent://" + ns1 + "/" + topicName;
@@ -1957,7 +1957,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTopicBundleRangeLookup() throws PulsarAdminException, PulsarServerException, Exception {
         admin.clusters().createCluster("usw", new ClusterData());
         TenantInfo tenantInfo = new TenantInfo(Sets.newHashSet("role1", "role2"),
@@ -1972,7 +1972,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(bundleRange, pulsar.getNamespaceService().getBundle(TopicName.get(topicName)).getBundleRange());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTriggerCompaction() throws Exception {
         String topicName = "persistent://prop-xyz/ns1/topic1";
 
@@ -2006,7 +2006,7 @@ public class AdminApiTest extends MockedPulsarServiceBaseTest {
         verify(compactor, times(2)).compact(topicName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCompactionStatus() throws Exception {
         String topicName = "persistent://prop-xyz/ns1/topic1";
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest2.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest2.java
index babf86f..4fc24ba 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest2.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTest2.java
@@ -86,7 +86,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
 
     private MockedPulsarService mockPulsarSetup;
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     public void setup() throws Exception {
         conf.setLoadBalancerEnabled(true);
@@ -104,7 +104,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
         admin.namespaces().createNamespace("prop-xyz/ns1", Sets.newHashSet("test"));
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
@@ -136,7 +136,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testIncrementPartitionsOfTopic() throws Exception {
         final String topicName = "increment-partitionedTopic";
         final String subName1 = topicName + "-my-sub-1/encode";
@@ -232,7 +232,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void nonPersistentTopics() throws Exception {
         final String topicName = "nonPersistentTopic";
 
@@ -291,7 +291,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testSetPersistencepolicies() throws Exception {
 
         final String namespace = "prop-xyz/ns2";
@@ -329,7 +329,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testUpdatePersistencePolicyUpdateManagedCursor() throws Exception {
 
         final String namespace = "prop-xyz/ns2";
@@ -372,7 +372,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test(dataProvider = "topicType")
+    @Test(timeOut = 10000, dataProvider = "topicType")
     public void testUnloadTopic(final String topicType) throws Exception {
 
         final String namespace = "prop-xyz/ns2";
@@ -529,7 +529,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testLoadReportApi() throws Exception {
 
         this.conf.setLoadManagerClassName(SimpleLoadManagerImpl.class.getName());
@@ -554,7 +554,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
         mockPulsarSetup2.cleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPeerCluster() throws Exception {
         admin.clusters().createCluster("us-west1",
                 new ClusterData("http://broker.messaging.west1.example.com" + ":" + BROKER_WEBSERVICE_PORT));
@@ -599,7 +599,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testReplicationPeerCluster() throws Exception {
         admin.clusters().createCluster("us-west1",
                 new ClusterData("http://broker.messaging.west1.example.com" + ":" + BROKER_WEBSERVICE_PORT));
@@ -651,7 +651,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
         admin.namespaces().setNamespaceReplicationClusters(namespace, clusterIds);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void clusterFailureDomain() throws PulsarAdminException {
 
         final String cluster = pulsar.getConfiguration().getClusterName();
@@ -684,7 +684,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
         assertTrue(domains.containsKey("domain-2"));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void namespaceAntiAffinity() throws PulsarAdminException {
         final String namespace = "prop-xyz/ns1";
         final String antiAffinityGroup = "group";
@@ -715,7 +715,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
         assertEquals(namespaces2.size(), 0);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNonPersistentTopics() throws Exception {
         final String namespace = "prop-xyz/ns2";
         final String topicName = "non-persistent://" + namespace + "/topic";
@@ -741,7 +741,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
         assertEquals(topicsInNs.size(), 0);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPublishConsumerStats() throws Exception {
         final String topicName = "statTopic";
         final String subscriberName = topicName + "-my-sub-1";
@@ -791,7 +791,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
         consumer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTenantNameWithUnderscore() throws Exception {
         TenantInfo tenantInfo = new TenantInfo(Sets.newHashSet("role1", "role2"), Sets.newHashSet("test"));
         admin.tenants().createTenant("prop_xyz", tenantInfo);
@@ -808,7 +808,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTenantNameWithInvalidCharacters() throws Exception {
         TenantInfo tenantInfo = new TenantInfo(Sets.newHashSet("role1", "role2"), Sets.newHashSet("test"));
 
@@ -828,7 +828,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTenantWithNonexistentClusters() throws Exception {
         // Check non-existing cluster
         assertFalse(admin.clusters().getClusters().contains("cluster-non-existing"));
@@ -858,7 +858,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void brokerNamespaceIsolationPolicies() throws Exception {
 
         // create
@@ -901,7 +901,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void clustersList() throws PulsarAdminException {
         final String cluster = pulsar.getConfiguration().getClusterName();
         admin.clusters().createCluster("global", new ClusterData("http://localhost:6650"));
@@ -914,7 +914,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testClusterIsReadyBeforeCreateTopic() throws PulsarAdminException {
         final String topicName = "partitionedTopic";
         final int partitions = 4;
@@ -935,7 +935,7 @@ public class AdminApiTest2 extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCreateNamespaceWithNoClusters() throws PulsarAdminException {
         String localCluster = pulsar.getConfiguration().getClusterName();
         String namespace = "prop-xyz/test-ns-with-no-clusters";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTlsAuthTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTlsAuthTest.java
index 6a5302e..d8cf234 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTlsAuthTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiTlsAuthTest.java
@@ -60,7 +60,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
         return String.format("./src/test/resources/authentication/tls-http/%s.pem", name);
     }
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     public void setup() throws Exception {
         conf.setLoadBalancerEnabled(true);
@@ -89,7 +89,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
         admin.close();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
@@ -137,7 +137,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
             .tlsTrustCertsFilePath(getTLSFile("ca.cert")).build();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSuperUserCanListTenants() throws Exception {
         try (PulsarAdmin admin = buildAdminClient("admin")) {
             admin.tenants().createTenant("tenant1",
@@ -147,7 +147,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProxyRoleCantListTenants() throws Exception {
         try (PulsarAdmin admin = buildAdminClient("admin")) {
             admin.tenants().createTenant("tenant1",
@@ -162,7 +162,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProxyRoleCantListNamespacesEvenWithAccess() throws Exception {
         try (PulsarAdmin admin = buildAdminClient("admin")) {
             admin.tenants().createTenant("tenant1",
@@ -178,7 +178,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAuthorizedUserAsOriginalPrincipal() throws Exception {
         try (PulsarAdmin admin = buildAdminClient("admin")) {
             admin.tenants().createTenant("tenant1",
@@ -194,7 +194,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
                             .get(new GenericType<List<String>>() {}));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUnauthorizedUserAsOriginalPrincipal() throws Exception {
         try (PulsarAdmin admin = buildAdminClient("admin")) {
             admin.tenants().createTenant("tenant1",
@@ -214,7 +214,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAuthorizedUserAsOriginalPrincipalButProxyNotAuthorized() throws Exception {
         try (PulsarAdmin admin = buildAdminClient("admin")) {
             admin.tenants().createTenant("tenant1",
@@ -234,7 +234,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAuthorizedUserAsOriginalPrincipalProxyIsSuperUser() throws Exception {
         try (PulsarAdmin admin = buildAdminClient("admin")) {
             admin.tenants().createTenant("tenant1",
@@ -250,7 +250,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
                             .get(new GenericType<List<String>>() {}));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUnauthorizedUserAsOriginalPrincipalProxyIsSuperUser() throws Exception {
         try (PulsarAdmin admin = buildAdminClient("admin")) {
             admin.tenants().createTenant("tenant1",
@@ -270,7 +270,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProxyUserViaProxy() throws Exception {
         try (PulsarAdmin admin = buildAdminClient("admin")) {
             admin.tenants().createTenant("tenant1",
@@ -290,7 +290,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSuperProxyUserAndAdminCanListTenants() throws Exception {
         try (PulsarAdmin admin = buildAdminClient("admin")) {
             admin.tenants().createTenant("tenant1",
@@ -305,7 +305,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
                             .get(new GenericType<List<String>>() {}));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSuperProxyUserAndNonAdminCannotListTenants() throws Exception {
         try (PulsarAdmin admin = buildAdminClient("admin")) {
             admin.tenants().createTenant("tenant1",
@@ -324,7 +324,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProxyCannotSetOriginalPrincipalAsEmpty() throws Exception {
         try (PulsarAdmin admin = buildAdminClient("admin")) {
             admin.tenants().createTenant("tenant1",
@@ -345,7 +345,7 @@ public class AdminApiTlsAuthTest extends MockedPulsarServiceBaseTest {
     }
 
     // For https://github.com/apache/pulsar/issues/2880
-    @Test
+    @Test(timeOut = 10000)
     public void testDeleteNamespace() throws Exception {
         try (PulsarAdmin admin = buildAdminClient("admin")) {
             log.info("Creating tenant");
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminResourceTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminResourceTest.java
index 7ad60c2..ce87a23 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminResourceTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminResourceTest.java
@@ -41,7 +41,7 @@ public class AdminResourceTest {
         };
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testValidatePartitionedTopicNameSuccess() {
         String tenant = "test-tenant";
         String namespace = "test-namespace";
@@ -51,7 +51,7 @@ public class AdminResourceTest {
         resource.validatePartitionedTopicName(tenant, namespace, topic);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testValidatePartitionedTopicNameInvalid() {
         String tenant = "test-tenant";
         String namespace = "test-namespace";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminTest.java
index 41bd877..9e64488 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminTest.java
@@ -91,7 +91,7 @@ import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-@Test
+@Test(timeOut = 10000)
 public class AdminTest extends MockedPulsarServiceBaseTest {
     private final String configClusterName = "use";
     private ConfigurationCacheService configurationCache;
@@ -115,7 +115,7 @@ public class AdminTest extends MockedPulsarServiceBaseTest {
     }
 
     @Override
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void setup() throws Exception {
         super.internalSetup();
 
@@ -203,12 +203,12 @@ public class AdminTest extends MockedPulsarServiceBaseTest {
     }
 
     @Override
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     public void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     void internalConfiguration() throws Exception {
         InternalConfigurationData expectedData = new InternalConfigurationData(
             pulsar.getConfiguration().getZookeeperServers(),
@@ -219,7 +219,7 @@ public class AdminTest extends MockedPulsarServiceBaseTest {
         assertEquals(brokers.getInternalConfigurationData(), expectedData);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     void clusters() throws Exception {
         assertEquals(clusters.getClusters(), Lists.newArrayList());
         verify(clusters, never()).validateSuperUserAccess();
@@ -369,7 +369,7 @@ public class AdminTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     void properties() throws Exception {
         assertEquals(properties.getTenants(), Lists.newArrayList());
         verify(properties, times(1)).validateSuperUserAccess();
@@ -517,7 +517,7 @@ public class AdminTest extends MockedPulsarServiceBaseTest {
         properties.deleteTenant("tenant-config-is-null");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     void brokers() throws Exception {
         clusters.createCluster("use", new ClusterData("http://broker.messaging.use.example.com",
                 "https://broker.messaging.use.example.com:4443"));
@@ -535,7 +535,7 @@ public class AdminTest extends MockedPulsarServiceBaseTest {
         assertEquals(activeBrokers, Sets.newHashSet(pulsar.getAdvertisedAddress() + ":" + BROKER_WEBSERVICE_PORT));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     void resourceQuotas() throws Exception {
         // get Default Resource Quota
         ResourceQuota quota = resourceQuotas.getDefaultResourceQuota();
@@ -597,7 +597,7 @@ public class AdminTest extends MockedPulsarServiceBaseTest {
         assertEquals(defaultBandwidth, bundleQuota.getBandwidthOut());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     void brokerStats() throws Exception {
         doReturn("client-id").when(brokerStats).clientAppId();
         Collection<Metrics> metrics = brokerStats.getMetrics();
@@ -621,7 +621,7 @@ public class AdminTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     void persistentTopics() throws Exception {
 
         final String property = "prop-xyz";
@@ -671,7 +671,7 @@ public class AdminTest extends MockedPulsarServiceBaseTest {
         assertTrue(permission.isEmpty());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testRestExceptionMessage() {
         String message = "my-message";
         RestException exception = new RestException(Status.PRECONDITION_FAILED, message);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/BrokerAdminClientTlsAuthTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/BrokerAdminClientTlsAuthTest.java
index 7cd2341..a925a59 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/BrokerAdminClientTlsAuthTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/BrokerAdminClientTlsAuthTest.java
@@ -45,7 +45,7 @@ import org.testng.annotations.Test;
 public class BrokerAdminClientTlsAuthTest extends MockedPulsarServiceBaseTest {
     protected String methodName;
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void beforeMethod(Method m) throws Exception {
         methodName = m.getName();
     }
@@ -54,7 +54,7 @@ public class BrokerAdminClientTlsAuthTest extends MockedPulsarServiceBaseTest {
         return String.format("./src/test/resources/authentication/tls-http/%s.pem", name);
     }
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     public void setup() throws Exception {
         conf.setBrokerServicePortTls(Optional.of(BROKER_PORT_TLS));
@@ -81,7 +81,7 @@ public class BrokerAdminClientTlsAuthTest extends MockedPulsarServiceBaseTest {
         conf.setTlsAllowInsecureConnection(true); 
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
@@ -105,7 +105,7 @@ public class BrokerAdminClientTlsAuthTest extends MockedPulsarServiceBaseTest {
      *           => Run list topics command
      * @throws Exception 
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testPersistentList() throws Exception {
         log.info("-- Starting {} test --", methodName);
         
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/CreateSubscriptionTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/CreateSubscriptionTest.java
index f5d8bd0..8632348 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/CreateSubscriptionTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/CreateSubscriptionTest.java
@@ -37,20 +37,20 @@ import org.testng.annotations.Test;
 
 public class CreateSubscriptionTest extends ProducerConsumerBase {
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     public void setup() throws Exception {
         super.internalSetup();
         producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void createSubscriptionSingleTopic() throws Exception {
         String topic = "persistent://my-property/my-ns/my-topic";
         admin.topics().createSubscription(topic, "sub-1", MessageId.latest);
@@ -83,7 +83,7 @@ public class CreateSubscriptionTest extends ProducerConsumerBase {
         assertEquals(admin.topics().getStats(topic).subscriptions.get("sub-5").msgBacklog, 1);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void createSubscriptionOnPartitionedTopic() throws Exception {
         String topic = "persistent://my-property/my-ns/my-partitioned-topic";
         admin.topics().createPartitionedTopic(topic, 10);
@@ -104,7 +104,7 @@ public class CreateSubscriptionTest extends ProducerConsumerBase {
         }
     }
     
-    @Test
+    @Test(timeOut = 10000)
     public void createSubscriptionOnPartitionedTopicWithPartialFailure() throws Exception {
         String topic = "persistent://my-property/my-ns/my-partitioned-topic";
         admin.topics().createPartitionedTopic(topic, 10);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/IncrementPartitionsTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/IncrementPartitionsTest.java
index 02430c8..314491c 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/IncrementPartitionsTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/IncrementPartitionsTest.java
@@ -37,7 +37,7 @@ public class IncrementPartitionsTest extends MockedPulsarServiceBaseTest {
 
     private MockedPulsarService mockPulsarSetup;
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     public void setup() throws Exception {
         conf.setLoadBalancerEnabled(true);
@@ -55,14 +55,14 @@ public class IncrementPartitionsTest extends MockedPulsarServiceBaseTest {
         admin.namespaces().createNamespace("prop-xyz/use/ns1");
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
         mockPulsarSetup.cleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testIncrementPartitionsOfTopicOnUnusedTopic() throws Exception {
         final String partitionedTopicName = "persistent://prop-xyz/use/ns1/test-topic";
 
@@ -73,7 +73,7 @@ public class IncrementPartitionsTest extends MockedPulsarServiceBaseTest {
         assertEquals(admin.topics().getPartitionedTopicMetadata(partitionedTopicName).partitions, 20);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testIncrementPartitionsOfTopic() throws Exception {
         final String partitionedTopicName = "persistent://prop-xyz/use/ns1/test-topic-2";
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesTest.java
index 0b22d2c..9c52fd2 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/NamespacesTest.java
@@ -91,7 +91,7 @@ import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-@Test
+@Test(timeOut = 10000)
 public class NamespacesTest extends MockedPulsarServiceBaseTest {
 
     private Namespaces namespaces;
@@ -112,7 +112,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         conf.setClusterName(testLocalCluster);
     }
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     public void initNamespace() throws Exception {
         testLocalNamespaces = Lists.newArrayList();
         testGlobalNamespaces = Lists.newArrayList();
@@ -130,7 +130,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
     }
 
     @Override
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     public void setup() throws Exception {
         super.internalSetup();
 
@@ -168,12 +168,12 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
     }
 
     @Override
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     public void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCreateNamespaces() throws Exception {
         try {
             namespaces.createNamespace(this.testTenant, "other-colo", "my-namespace", new BundlesData());
@@ -219,7 +219,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetNamespaces() throws Exception {
         List<String> expectedList = Lists.newArrayList(this.testLocalNamespaces.get(0).toString(),
                 this.testLocalNamespaces.get(1).toString());
@@ -264,7 +264,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
 
     }
 
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testGrantAndRevokePermissions() throws Exception {
         Policies expectedPolicies = new Policies();
         assertEquals(namespaces.getPolicies(this.testTenant, this.testLocalCluster,
@@ -383,7 +383,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGlobalNamespaceReplicationConfiguration() throws Exception {
         assertEquals(
                 namespaces.getNamespaceReplicationClusters(this.testGlobalNamespaces.get(0).getTenant(),
@@ -507,7 +507,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetBundles() throws Exception {
         BundlesData bundle = new BundlesData(Lists.newArrayList("0x00000000", "0x80000000", "0xffffffff"));
         createBundledTestNamespaces(this.testTenant, this.testLocalCluster, "test-bundled-namespace-1", bundle);
@@ -517,7 +517,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         assertEquals(responseData, bundle);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNamespacesApiRedirects() throws Exception {
         // Redirect cases
         uriField.set(namespaces, uriInfo);
@@ -585,7 +585,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
                 UriBuilder.fromUri(uri).host("broker-usc.com").port(BROKER_WEBSERVICE_PORT).toString());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDeleteNamespaces() throws Exception {
         AsyncResponse response = mock(AsyncResponse.class);
         namespaces.deleteNamespace(response, this.testTenant, this.testLocalCluster, "non-existing-namespace-1", false);
@@ -663,7 +663,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         assertEquals(responseCaptor.getValue().getStatus(), Status.NO_CONTENT.getStatusCode());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDeleteNamespaceWithBundles() throws Exception {
         URL localWebServiceUrl = new URL(pulsar.getSafeWebServiceAddress());
         String bundledNsLocal = "test-bundled-namespace-1";
@@ -745,7 +745,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         doNothing().when(namespacesAdmin).deleteNamespaceBundle(Mockito.anyString(), Mockito.anyString());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUnloadNamespaces() throws Exception {
         final NamespaceName testNs = this.testLocalNamespaces.get(1);
         URL localWebServiceUrl = new URL(pulsar.getSafeWebServiceAddress());
@@ -764,7 +764,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         assertEquals(captor.getValue().getStatus(), Status.NO_CONTENT.getStatusCode());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSplitBundles() throws Exception {
         URL localWebServiceUrl = new URL(pulsar.getSafeWebServiceAddress());
         String bundledNsLocal = "test-bundled-namespace-1";
@@ -795,7 +795,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSplitBundleWithUnDividedRange() throws Exception {
         URL localWebServiceUrl = new URL(pulsar.getSafeWebServiceAddress());
         String bundledNsLocal = "test-bundled-namespace-1";
@@ -820,7 +820,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUnloadNamespaceWithBundles() throws Exception {
         URL localWebServiceUrl = new URL(pulsar.getSafeWebServiceAddress());
         String bundledNsLocal = "test-bundled-namespace-1";
@@ -867,7 +867,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testValidateAdminAccessOnTenant() throws Exception {
 
         try {
@@ -886,7 +886,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testValidateNamespaceOwnershipWithBundles() throws Exception {
         try {
             URL localWebServiceUrl = new URL(pulsar.getSafeWebServiceAddress());
@@ -908,7 +908,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testRetention() throws Exception {
         try {
             URL localWebServiceUrl = new URL(pulsar.getSafeWebServiceAddress());
@@ -933,7 +933,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testRetentionUnauthorized() throws Exception {
         try {
             NamespaceName testNs = this.testLocalNamespaces.get(3);
@@ -945,7 +945,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPersistence() throws Exception {
         NamespaceName testNs = this.testLocalNamespaces.get(0);
         PersistencePolicies persistence1 = new PersistencePolicies(3, 2, 1, 0.0);
@@ -955,7 +955,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         assertEquals(persistence2, persistence1);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPersistenceUnauthorized() throws Exception {
         try {
             NamespaceName testNs = this.testLocalNamespaces.get(3);
@@ -967,7 +967,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testValidateTopicOwnership() throws Exception {
         URL localWebServiceUrl = new URL(pulsar.getSafeWebServiceAddress());
         String bundledNsLocal = "test-bundled-namespace-1";
@@ -994,7 +994,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
         topics.validateAdminOperationOnTopic(false);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testIsLeader() throws Exception {
         assertTrue(namespaces.isLeaderBroker());
     }
@@ -1004,7 +1004,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testDeleteNamespace() throws Exception {
 
         final String namespace = this.testTenant + "/use/deleteNs";
@@ -1030,7 +1030,7 @@ public class NamespacesTest extends MockedPulsarServiceBaseTest {
 
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testSubscribeRate() throws Exception {
         SubscribeRate subscribeRate = new SubscribeRate(1, 5);
         String namespace = "my-tenants/my-namespace";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/PersistentTopicsTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/PersistentTopicsTest.java
index fc89acc..0886f30 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/PersistentTopicsTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/PersistentTopicsTest.java
@@ -66,7 +66,7 @@ public class PersistentTopicsTest extends MockedPulsarServiceBaseTest {
     protected UriInfo uriInfo;
     private NonPersistentTopics nonPersistentTopic;
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     public void initPersistentTopics() throws Exception {
         uriField = PulsarWebResource.class.getDeclaredField("uri");
         uriField.setAccessible(true);
@@ -74,7 +74,7 @@ public class PersistentTopicsTest extends MockedPulsarServiceBaseTest {
     }
 
     @Override
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     protected void setup() throws Exception {
         super.internalSetup();
         persistentTopics = spy(new PersistentTopics());
@@ -114,12 +114,12 @@ public class PersistentTopicsTest extends MockedPulsarServiceBaseTest {
     }
 
     @Override
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetSubscriptions() {
         String testLocalTopicName = "topic-not-found";
 
@@ -191,7 +191,7 @@ public class PersistentTopicsTest extends MockedPulsarServiceBaseTest {
         Assert.assertEquals(responseCaptor.getValue().getStatus(), Response.Status.NO_CONTENT.getStatusCode());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNonPartitionedTopics() {
         pulsar.getConfiguration().setAllowAutoTopicCreation(false);
         final String nonPartitionTopic = "non-partitioned-topic";
@@ -216,7 +216,7 @@ public class PersistentTopicsTest extends MockedPulsarServiceBaseTest {
                 0);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCreateNonPartitionedTopic() {
         final String topicName = "standard-topic";
         persistentTopics.createNonPartitionedTopic(testTenant, testNamespace, topicName, true);
@@ -225,14 +225,14 @@ public class PersistentTopicsTest extends MockedPulsarServiceBaseTest {
         Assert.assertEquals(pMetadata.partitions, 0);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUnloadTopic() {
         final String topicName = "standard-topic-to-be-unload";
         persistentTopics.createNonPartitionedTopic(testTenant, testNamespace, topicName, true);
         persistentTopics.unloadTopic(testTenant, testNamespace, topicName, true);
     }
 
-    @Test(expectedExceptions = RestException.class)
+    @Test(timeOut = 10000, expectedExceptions = RestException.class)
     public void testUnloadTopicShallThrowNotFoundWhenTopicNotExist() {
         try {
             persistentTopics.unloadTopic(testTenant, testNamespace,"non-existent-topic", true);
@@ -242,7 +242,7 @@ public class PersistentTopicsTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetPartitionedTopicsList() throws KeeperException, InterruptedException, PulsarAdminException {
 
         persistentTopics.createPartitionedTopic(testTenant, testNamespace, "test-topic1", 3);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest.java
index b98cbc6..848501c 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest.java
@@ -136,7 +136,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
 
     private NamespaceBundleFactory bundleFactory;
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     public void setup() throws Exception {
         conf.setLoadBalancerEnabled(true);
@@ -166,7 +166,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.namespaces().createNamespace("prop-xyz/use/ns1");
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         adminTls.close();
@@ -194,7 +194,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         return new Object[][] { { TopicDomain.persistent.value() }, { TopicDomain.non_persistent.value() } };
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void clusters() throws Exception {
         admin.clusters().createCluster("usw",
                 new ClusterData("http://broker.messaging.use.example.com" + ":" + BROKER_WEBSERVICE_PORT));
@@ -237,7 +237,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void clusterNamespaceIsolationPolicies() throws PulsarAdminException {
         try {
             // create
@@ -384,7 +384,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void brokers() throws Exception {
         List<String> list = admin.brokers().getActiveBrokers("use");
         Assert.assertNotNull(list);
@@ -430,7 +430,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testUpdateDynamicConfigurationWithZkWatch() throws Exception {
         final int initValue = 30000;
         pulsar.getConfiguration().setBrokerShutdownTimeoutMs(initValue);
@@ -483,7 +483,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testInvalidDynamicConfigContentInZK() throws Exception {
         final int newValue = 10;
         stopBroker();
@@ -520,7 +520,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testUpdateDynamicLocalConfiguration() throws Exception {
         // (1) try to update dynamic field
         final long initValue = 30000;
@@ -539,14 +539,14 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(pulsar.getConfiguration().getBrokerShutdownTimeoutMs(), shutdownTime);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUpdatableConfigurationName() throws Exception {
         // (1) try to update dynamic field
         final String configName = "brokerShutdownTimeoutMs";
         assertTrue(admin.brokers().getDynamicConfigurationNames().contains(configName));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetDynamicLocalConfiguration() throws Exception {
         // (1) try to update dynamic field
         final String configName = "brokerShutdownTimeoutMs";
@@ -561,7 +561,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(Long.parseLong(admin.brokers().getAllDynamicConfigurations().get(configName)), shutdownTime);
     }
 
-    @Test(enabled = true)
+    @Test(timeOut = 10000)
     public void properties() throws PulsarAdminException {
         Set<String> allowedClusters = Sets.newHashSet("use");
         TenantInfo tenantInfo = new TenantInfo(Sets.newHashSet("role1", "role2"), allowedClusters);
@@ -589,7 +589,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test(invocationCount = 1)
+    @Test(timeOut = 10000, invocationCount = 1)
     public void namespaces() throws PulsarAdminException, PulsarServerException, Exception {
         admin.clusters().createCluster("usw", new ClusterData());
         TenantInfo tenantInfo = new TenantInfo(Sets.newHashSet("role1", "role2"),
@@ -692,7 +692,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         // otheradmin.namespaces().unload("prop-xyz/use/ns2");
     }
 
-    @Test(dataProvider = "topicName")
+    @Test(timeOut = 10000, dataProvider = "topicName")
     public void persistentTopics(String topicName) throws Exception {
         assertEquals(admin.topics().getList("prop-xyz/use/ns1"), Lists.newArrayList());
 
@@ -770,7 +770,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(admin.topics().getList("prop-xyz/use/ns1"), Lists.newArrayList());
     }
 
-    @Test(dataProvider = "topicName")
+    @Test(timeOut = 10000, dataProvider = "topicName")
     public void partitionedTopics(String topicName) throws Exception {
         assertEquals(admin.topics().getPartitionedTopicList("prop-xyz/use/ns1"), Lists.newArrayList());
         final String partitionedTopicName = "persistent://prop-xyz/use/ns1/" + topicName;
@@ -914,7 +914,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().deletePartitionedTopic(partitionedTopicName);
     }
 
-    @Test(dataProvider = "numBundles")
+    @Test(timeOut = 10000, dataProvider = "numBundles")
     public void testDeleteNamespaceBundle(Integer numBundles) throws Exception {
         admin.namespaces().deleteNamespace("prop-xyz/use/ns1");
         admin.namespaces().createNamespace("prop-xyz/use/ns1-bundles", numBundles);
@@ -931,7 +931,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(admin.namespaces().getNamespaces("prop-xyz", "use"), Lists.newArrayList());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNamespaceSplitBundle() throws Exception {
         // Force to create a topic
         final String namespace = "prop-xyz/use/ns1";
@@ -961,7 +961,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNamespaceSplitBundleConcurrent() throws Exception {
         // Force to create a topic
         final String namespace = "prop-xyz/use/ns1";
@@ -1074,7 +1074,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNamespaceUnloadBundle() throws Exception {
         assertEquals(admin.topics().getList("prop-xyz/use/ns1"), Lists.newArrayList());
 
@@ -1133,7 +1133,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().delete("persistent://prop-xyz/use/ns1/ds2");
     }
 
-    @Test(dataProvider = "numBundles")
+    @Test(timeOut = 10000, dataProvider = "numBundles")
     public void testNamespaceBundleUnload(Integer numBundles) throws Exception {
         admin.namespaces().createNamespace("prop-xyz/use/ns1-bundles", numBundles);
 
@@ -1190,7 +1190,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().delete("persistent://prop-xyz/use/ns1-bundles/ds2");
     }
 
-    @Test(dataProvider = "bundling")
+    @Test(timeOut = 10000, dataProvider = "bundling")
     public void testClearBacklogOnNamespace(Integer numBundles) throws Exception {
         admin.namespaces().createNamespace("prop-xyz/use/ns1-bundles", numBundles);
 
@@ -1257,7 +1257,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(backlog, 0);
     }
 
-    @Test(dataProvider = "bundling")
+    @Test(timeOut = 10000, dataProvider = "bundling")
     public void testUnsubscribeOnNamespace(Integer numBundles) throws Exception {
         admin.namespaces().createNamespace("prop-xyz/use/ns1-bundles", numBundles);
 
@@ -1331,7 +1331,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void backlogQuotas() throws Exception {
         assertEquals(admin.namespaces().getBacklogQuotaMap("prop-xyz/use/ns1"),
                 ConfigHelper.backlogQuotaMap(conf));
@@ -1354,7 +1354,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(quotaMap.get(BacklogQuotaType.destination_storage), ConfigHelper.backlogQuota(conf));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void statsOnNonExistingTopics() throws Exception {
         try {
             admin.topics().getStats("persistent://prop-xyz/use/ns1/ghostTopic");
@@ -1364,7 +1364,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDeleteFailedReturnCode() throws Exception {
         String topicName = "persistent://prop-xyz/use/ns1/my-topic";
         Producer<byte[]> producer = pulsarClient.newProducer(Schema.BYTES)
@@ -1410,7 +1410,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         public String someNewString;
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testJacksonWithTypeDifferencies() throws Exception {
         String expectedJson = "{\"adminRoles\":[\"role1\",\"role2\"],\"allowedClusters\":[\"usw\",\"use\"]}";
         IncompatiblePropertyAdmin r1 = ObjectMapperFactory.getThreadLocal().readerFor(IncompatiblePropertyAdmin.class)
@@ -1420,7 +1420,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         assertNull(r1.someNewString);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBackwardCompatiblity() throws Exception {
         assertEquals(admin.tenants().getTenants(), Lists.newArrayList("prop-xyz"));
         assertEquals(admin.tenants().getTenantInfo("prop-xyz").getAdminRoles(),
@@ -1442,7 +1442,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(admin.tenants().getTenants(), Lists.newArrayList());
     }
 
-    @Test(dataProvider = "topicName")
+    @Test(timeOut = 10000, dataProvider = "topicName")
     public void persistentTopicsCursorReset(String topicName) throws Exception {
         admin.namespaces().setRetention("prop-xyz/use/ns1", new RetentionPolicies(10, 10));
 
@@ -1494,7 +1494,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().delete(topicName);
     }
 
-    @Test(dataProvider = "topicName")
+    @Test(timeOut = 10000, dataProvider = "topicName")
     public void persistentTopicsCursorResetAfterReset(String topicName) throws Exception {
         admin.namespaces().setRetention("prop-xyz/use/ns1", new RetentionPolicies(10, 10));
         assertEquals(admin.topics().getList("prop-xyz/use/ns1"), Lists.newArrayList());
@@ -1565,7 +1565,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().delete(topicName);
     }
 
-    @Test(dataProvider = "topicName")
+    @Test(timeOut = 10000, dataProvider = "topicName")
     public void partitionedTopicsCursorReset(String topicName) throws Exception {
         admin.namespaces().setRetention("prop-xyz/use/ns1", new RetentionPolicies(10, 10));
         topicName = "persistent://prop-xyz/use/ns1/" + topicName;
@@ -1612,7 +1612,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().deletePartitionedTopic(topicName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void persistentTopicsInvalidCursorReset() throws Exception {
         admin.namespaces().setRetention("prop-xyz/use/ns1", new RetentionPolicies(10, 10));
 
@@ -1660,7 +1660,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         admin.topics().delete(topicName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testObjectWithUnknowProperties() {
 
         class CustomPropertyAdmin extends TenantInfo {
@@ -1692,7 +1692,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testPersistentTopicsExpireMessages() throws Exception {
 
         // Force to create a topic
@@ -1747,7 +1747,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testPersistentTopicExpireMessageOnParitionTopic() throws Exception {
 
         admin.topics().createPartitionedTopic("persistent://prop-xyz/use/ns1/ds1", 4);
@@ -1804,7 +1804,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
      * @param topicName
      * @throws Exception
      */
-    @Test(dataProvider = "topicName")
+    @Test(timeOut = 10000, dataProvider = "topicName")
     public void testPulsarAdminForUriAndUrlEncoding(String topicName) throws Exception {
         final String ns1 = "prop-xyz/use/ns1";
         final String topic1 = "persistent://" + ns1 + "/" + topicName;
@@ -1930,7 +1930,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTopicBundleRangeLookup() throws PulsarAdminException, PulsarServerException, Exception {
         admin.clusters().createCluster("usw", new ClusterData());
         TenantInfo tenantInfo = new TenantInfo(Sets.newHashSet("role1", "role2"),
@@ -1945,7 +1945,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         assertEquals(bundleRange, pulsar.getNamespaceService().getBundle(TopicName.get(topicName)).getBundleRange());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTriggerCompaction() throws Exception {
         String topicName = "persistent://prop-xyz/use/ns1/topic1";
 
@@ -1979,7 +1979,7 @@ public class V1_AdminApiTest extends MockedPulsarServiceBaseTest {
         verify(compactor, times(2)).compact(topicName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCompactionStatus() throws Exception {
         String topicName = "persistent://prop-xyz/use/ns1/topic1";
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest2.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest2.java
index 76244df..79ba479 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest2.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/v1/V1_AdminApiTest2.java
@@ -78,7 +78,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
 
     private MockedPulsarService mockPulsarSetup;
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     public void setup() throws Exception {
         conf.setLoadBalancerEnabled(true);
@@ -96,7 +96,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
         admin.namespaces().createNamespace("prop-xyz/use/ns1");
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
@@ -126,10 +126,9 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * </pre>
      *
-     * @param topicName
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testIncrementPartitionsOfTopic() throws Exception {
         final String topicName = "increment-partitionedTopic";
         final String subName1 = topicName + "-my-sub-1";
@@ -224,7 +223,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void nonPersistentTopics() throws Exception {
         final String topicName = "nonPersistentTopic";
 
@@ -283,7 +282,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testSetPersistencepolicies() throws Exception {
 
         final String namespace = "prop-xyz/use/ns2";
@@ -321,7 +320,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testUpdatePersistencePolicyUpdateManagedCursor() throws Exception {
 
         final String namespace = "prop-xyz/use/ns2";
@@ -364,7 +363,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test(dataProvider = "topicType")
+    @Test(timeOut = 10000, dataProvider = "topicType")
     public void testUnloadTopic(final String topicType) throws Exception {
 
         final String namespace = "prop-xyz/use/ns2";
@@ -525,7 +524,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testLoadReportApi() throws Exception {
 
         this.conf.setLoadManagerClassName(SimpleLoadManagerImpl.class.getName());
@@ -550,7 +549,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
         mockPulsarSetup2.cleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPeerCluster() throws Exception {
         admin.clusters().createCluster("us-west1",
                 new ClusterData("http://broker.messaging.west1.example.com" + ":" + BROKER_WEBSERVICE_PORT));
@@ -595,7 +594,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testReplicationPeerCluster() throws Exception {
         admin.clusters().createCluster("us-west1",
                 new ClusterData("http://broker.messaging.west1.example.com" + ":" + BROKER_WEBSERVICE_PORT));
@@ -647,7 +646,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
         admin.namespaces().setNamespaceReplicationClusters(namespace, clusterIds);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void clusterFailureDomain() throws PulsarAdminException {
 
         final String cluster = pulsar.getConfiguration().getClusterName();
@@ -682,7 +681,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
         assertTrue(domains.containsKey("domain-2"));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void namespaceAntiAffinity() throws PulsarAdminException {
         final String namespace = "prop-xyz/use/ns1";
         final String antiAffinityGroup = "group";
@@ -713,7 +712,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
         assertEquals(namespaces2.size(), 0);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNonPersistentTopics() throws Exception {
         final String namespace = "prop-xyz/use/ns2";
         final String topicName = "non-persistent://" + namespace + "/topic";
@@ -742,7 +741,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
         assertEquals(topicsInNs.size(), 0);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPublishConsumerStats() throws Exception {
         final String topicName = "statTopic";
         final String subscriberName = topicName + "-my-sub-1";
@@ -792,7 +791,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
         consumer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTenantNameWithUnderscore() throws Exception {
         TenantInfo tenantInfo = new TenantInfo(Sets.newHashSet("role1", "role2"), Sets.newHashSet("use"));
         admin.tenants().createTenant("prop_xyz", tenantInfo);
@@ -812,7 +811,7 @@ public class V1_AdminApiTest2 extends MockedPulsarServiceBaseTest {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTenantNameWithInvalidCharacters() throws Exception {
         TenantInfo tenantInfo = new TenantInfo(Sets.newHashSet("role1", "role2"), Sets.newHashSet("use"));
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/AuthorizationTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/AuthorizationTest.java
index 1ab5cc9..829a3b9 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/AuthorizationTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/AuthorizationTest.java
@@ -36,14 +36,14 @@ import org.testng.annotations.Test;
 
 import com.google.common.collect.Sets;
 
-@Test
+@Test(timeOut = 10000)
 public class AuthorizationTest extends MockedPulsarServiceBaseTest {
 
     public AuthorizationTest() {
         super();
     }
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     @Override
     protected void setup() throws Exception {
         conf.setClusterName("c1");
@@ -53,13 +53,13 @@ public class AuthorizationTest extends MockedPulsarServiceBaseTest {
         internalSetup();
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     @Override
     protected void cleanup() throws Exception {
         internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     void simple() throws Exception {
         AuthorizationService auth = pulsar.getBrokerService().getAuthorizationService();
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/MockedPulsarServiceBaseTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/MockedPulsarServiceBaseTest.java
index 341b96a..0767bef 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/MockedPulsarServiceBaseTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/auth/MockedPulsarServiceBaseTest.java
@@ -152,24 +152,30 @@ public abstract class MockedPulsarServiceBaseTest {
             // an NPE in shutdown, obscuring the real error
             if (admin != null) {
                 admin.close();
+                admin = null;
             }
             if (pulsarClient != null) {
                 pulsarClient.close();
             }
             if (pulsar != null) {
                 pulsar.close();
+                pulsar = null;
             }
             if (mockBookKeeper != null) {
                 mockBookKeeper.reallyShutdown();
+                mockBookKeeper = null;
             }
             if (mockZookKeeper != null) {
                 mockZookKeeper.shutdown();
+                mockZookKeeper = null;
             }
             if (sameThreadOrderedSafeExecutor != null) {
                 sameThreadOrderedSafeExecutor.shutdown();
+                sameThreadOrderedSafeExecutor = null;
             }
             if (bkExecutor != null) {
                 bkExecutor.shutdown();
+                bkExecutor = null;
             }
         } catch (Exception e) {
             log.warn("Failed to clean up mocked pulsar service:", e);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/cache/ResourceQuotaCacheTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/cache/ResourceQuotaCacheTest.java
index 6fb4286..1f38d66 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/cache/ResourceQuotaCacheTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/cache/ResourceQuotaCacheTest.java
@@ -50,7 +50,7 @@ public class ResourceQuotaCacheTest {
     private NamespaceBundleFactory bundleFactory;
     private OrderedScheduler executor;
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     public void setup() throws Exception {
         pulsar = mock(PulsarService.class);
         executor = OrderedScheduler.newSchedulerBuilder().numThreads(1).name("test").build();
@@ -59,22 +59,22 @@ public class ResourceQuotaCacheTest {
 
         // set mock pulsar localzkcache
         LocalZooKeeperCacheService localZkCache = mock(LocalZooKeeperCacheService.class);
-        ZooKeeperDataCache<LocalPolicies> poilciesCache = mock(ZooKeeperDataCache.class);
+        ZooKeeperDataCache<LocalPolicies> policiesCache = mock(ZooKeeperDataCache.class);
         when(pulsar.getLocalZkCacheService()).thenReturn(localZkCache);
-        when(localZkCache.policiesCache()).thenReturn(poilciesCache);
-        doNothing().when(poilciesCache).registerListener(any());
+        when(localZkCache.policiesCache()).thenReturn(policiesCache);
+        doNothing().when(policiesCache).registerListener(any());
         bundleFactory = new NamespaceBundleFactory(pulsar, Hashing.crc32());
 
         doReturn(zkCache).when(pulsar).getLocalZkCache();
         doReturn(localCache).when(pulsar).getLocalZkCacheService();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     public void teardown() {
         executor.shutdown();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetSetDefaultQuota() throws Exception {
         ResourceQuotaCache cache = new ResourceQuotaCache(zkCache);
         ResourceQuota quota1 = ResourceQuotaCache.getInitialQuotaValue();
@@ -91,7 +91,7 @@ public class ResourceQuotaCacheTest {
         assertEquals(cache.getDefaultQuota(), quota2);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetSetBundleQuota() throws Exception {
         ResourceQuotaCache cache = new ResourceQuotaCache(zkCache);
         NamespaceBundle testBundle = bundleFactory.getFullBundle(NamespaceName.get("pulsar/test/ns-2"));
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/delayed/InMemoryDeliveryTrackerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/delayed/InMemoryDeliveryTrackerTest.java
index b6f958d..70ef64e 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/delayed/InMemoryDeliveryTrackerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/delayed/InMemoryDeliveryTrackerTest.java
@@ -48,7 +48,7 @@ import org.testng.annotations.Test;
 
 public class InMemoryDeliveryTrackerTest {
 
-    @Test
+    @Test(timeOut = 10000)
     public void test() throws Exception {
         PersistentDispatcherMultipleConsumers dispatcher = mock(PersistentDispatcherMultipleConsumers.class);
 
@@ -103,7 +103,7 @@ public class InMemoryDeliveryTrackerTest {
         assertEquals(tracker.getScheduledMessages(10), Collections.emptySet());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testWithTimer() throws Exception {
         PersistentDispatcherMultipleConsumers dispatcher = mock(PersistentDispatcherMultipleConsumers.class);
         Timer timer = mock(Timer.class);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/AntiAffinityNamespaceGroupTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/AntiAffinityNamespaceGroupTest.java
index 2c33538..171ad83 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/AntiAffinityNamespaceGroupTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/AntiAffinityNamespaceGroupTest.java
@@ -107,7 +107,7 @@ public class AntiAffinityNamespaceGroupTest {
         return field.get(instance);
     }
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     void setup() throws Exception {
 
         // Start local bookkeeper ensemble
@@ -156,7 +156,7 @@ public class AntiAffinityNamespaceGroupTest {
         Thread.sleep(100);
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     void shutdown() throws Exception {
         log.info("--- Shutting down ---");
         executor.shutdown();
@@ -177,7 +177,7 @@ public class AntiAffinityNamespaceGroupTest {
                 Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testClusterDomain() {
 
     }
@@ -205,7 +205,7 @@ public class AntiAffinityNamespaceGroupTest {
      * </pre>
      *
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testAntiAffinityNamespaceFilteringWithDomain() throws Exception {
 
         final String namespace = "my-tenant/use/my-ns";
@@ -303,7 +303,7 @@ public class AntiAffinityNamespaceGroupTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testAntiAffinityNamespaceFilteringWithoutDomain() throws Exception {
 
         final String namespace = "my-tenant/use/my-ns";
@@ -386,7 +386,7 @@ public class AntiAffinityNamespaceGroupTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokerSelectionForAntiAffinityGroup() throws Exception {
 
         final String broker1 = primaryHost;
@@ -439,7 +439,7 @@ public class AntiAffinityNamespaceGroupTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testLoadSheddingUtilWithAntiAffinityNamespace() throws Exception {
 
         final String namespace = "my-tenant/use/my-ns";
@@ -492,7 +492,7 @@ public class AntiAffinityNamespaceGroupTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testLoadSheddingWithAntiAffinityNamespace() throws Exception {
 
         final String namespace = "my-tenant/use/my-ns";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/BrokerVersionFilterTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/BrokerVersionFilterTest.java
index 760ef07..39b831d 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/BrokerVersionFilterTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/BrokerVersionFilterTest.java
@@ -35,7 +35,7 @@ import com.github.zafarkhaja.semver.Version;
 
 public class BrokerVersionFilterTest {
 
-    @Test
+    @Test(timeOut = 10000)
     public void testLatestVersion() {
         LoadData loadData = initLoadData();
         Set<String> brokers = new TreeSet<>();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadBalancerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadBalancerTest.java
index a7102a0..923d83d 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadBalancerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadBalancerTest.java
@@ -119,10 +119,10 @@ public class LoadBalancerTest {
     private PulsarService[] pulsarServices = new PulsarService[BROKER_COUNT];
     private PulsarAdmin[] pulsarAdmins = new PulsarAdmin[BROKER_COUNT];
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 20000)
     void setup() throws Exception {
         // Start local bookkeeper ensemble
-        bkEnsemble = new LocalBookkeeperEnsemble(3, ZOOKEEPER_PORT, () -> PortManager.nextFreePort());
+        bkEnsemble = new LocalBookkeeperEnsemble(3, ZOOKEEPER_PORT, PortManager::nextFreePort);
         bkEnsemble.start();
         ZkUtils.createFullPathOptimistic(bkEnsemble.getZkClient(),
                 SimpleLoadManagerImpl.LOADBALANCER_DYNAMIC_SETTING_STRATEGY_ZPATH,
@@ -160,7 +160,7 @@ public class LoadBalancerTest {
         Thread.sleep(100);
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     void shutdown() throws Exception {
         log.info("--- Shutting down ---");
         executor.shutdown();
@@ -198,7 +198,7 @@ public class LoadBalancerTest {
      * reports are not, both broker will have zero rank
      */
     @SuppressWarnings("unchecked")
-    @Test
+    @Test(timeOut = 10000)
     public void testLoadReportsWrittenOnZK() throws Exception {
         ZooKeeper zkc = bkEnsemble.getZkClient();
         try {
@@ -240,7 +240,7 @@ public class LoadBalancerTest {
      * tests rankings get updated when we write write the new load reports to the zookeeper on loadbalance root node
      * tests writing pre-configured load report on the zookeeper translates the pre-calculated rankings
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testUpdateLoadReportAndCheckUpdatedRanking() throws Exception {
         for (int i = 0; i < BROKER_COUNT; i++) {
             LoadReport lr = new LoadReport();
@@ -312,7 +312,7 @@ public class LoadBalancerTest {
      * bottleneck, for the 4/5th brokers CPU become bottleneck since memory is big enough - non-bundles assigned so all
      * idle resources are avaiable for new bundle Check the broker rankings are the load percentage of each broker.
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokerRanking() throws Exception {
         for (int i = 0; i < BROKER_COUNT; i++) {
             LoadReport lr = new LoadReport();
@@ -357,7 +357,7 @@ public class LoadBalancerTest {
      * bottleneck, for the 4/5th brokers CPU become bottleneck since memory is big enough - already has some bundles
      * assigned Check the distribution of new topics is roughly consistent (with <10% variation) with the ranking
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testTopicAssignmentWithExistingBundles() throws Exception {
         for (int i = 0; i < BROKER_COUNT; i++) {
             ResourceQuota defaultQuota = new ResourceQuota();
@@ -435,7 +435,7 @@ public class LoadBalancerTest {
     /**
      * Ensure that the load manager's zookeeper data cache is shutdown after invoking stop().
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testStop() throws Exception {
         final SimpleLoadManagerImpl loadManager = (SimpleLoadManagerImpl) pulsarServices[0].getLoadManager().get();
         loadManager.stop();
@@ -513,7 +513,7 @@ public class LoadBalancerTest {
     /*
      * Test broker dynamically calculating resource quota for each connected namespace bundle.
      */
-    @Test
+    @Test(timeOut = 20000)
     public void testDynamicNamespaceBundleQuota() throws Exception {
         long startTime = System.currentTimeMillis();
         for (int i = 0; i < BROKER_COUNT; i++) {
@@ -615,7 +615,7 @@ public class LoadBalancerTest {
     /**
      * Test the namespace bundle auto-split
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testNamespaceBundleAutoSplit() throws Exception {
         int maxBundles = pulsarServices[0].getConfiguration().getLoadBalancerNamespaceMaximumBundles();
         long maxTopics = pulsarServices[0].getConfiguration().getLoadBalancerNamespaceBundleMaxTopics();
@@ -702,7 +702,7 @@ public class LoadBalancerTest {
     /*
      * Test all brokers are consistent on current leader and close leader to trigger re-election.
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testLeaderElection() throws Exception {
         for (int i = 0; i < BROKER_COUNT - 1; i++) {
             Set<PulsarService> activePulsar = new HashSet<PulsarService>();
@@ -801,7 +801,7 @@ public class LoadBalancerTest {
 
     }
 
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testGetLeastLoadedBasic() throws Exception {
         LocalZooKeeperCache mockCache = mock(LocalZooKeeperCache.class);
         Set<String> activeBrokers = Sets.newHashSet("prod1-broker1.messaging.use.example.com:8080",
@@ -865,7 +865,7 @@ public class LoadBalancerTest {
      * should be divided fairly equally with about 10% of variation
      *
      */
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testLoadbalanceDistributionAmongEquallyLoaded() throws Exception {
         LoadManager loadManager = new SimpleLoadManagerImpl(pulsarServices[0]);
         ZooKeeperCache mockCache = mock(ZooKeeperCache.class);
@@ -910,7 +910,7 @@ public class LoadBalancerTest {
      *
      * We should not see any of these inactive brokers assigned any namespace.
      */
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     void testLoadBalanceDiscardingInactiveBrokersInSelection() throws Exception {
         long memoryMB = 2096;
         long cpuPercent = 12;
@@ -967,7 +967,7 @@ public class LoadBalancerTest {
         assertFalse(namespaceOwner.containsKey(inactiveBroker));
     }
 
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     void testLoadBalanceDistributionAmongUnequallyLoaded() throws Exception {
         long memoryMB = 4096;
         long cpuPercent = 25;
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadReportNetworkLimit.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadReportNetworkLimit.java
index c9e7510..2666057 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadReportNetworkLimit.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/LoadReportNetworkLimit.java
@@ -28,7 +28,7 @@ import static org.testng.Assert.*;
 
 public class LoadReportNetworkLimit extends MockedPulsarServiceBaseTest {
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     @Override
     public void setup() throws Exception {
         conf.setLoadBalancerEnabled(true);
@@ -36,13 +36,13 @@ public class LoadReportNetworkLimit extends MockedPulsarServiceBaseTest {
         super.internalSetup();
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void checkLoadReportNicSpeed() throws Exception {
         // Since we have overridden the NIC speed in the configuration, the load report for the broker should always
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/ModularLoadManagerImplTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/ModularLoadManagerImplTest.java
index e3e380a..998cefd 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/ModularLoadManagerImplTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/ModularLoadManagerImplTest.java
@@ -142,7 +142,7 @@ public class ModularLoadManagerImplTest {
         field.set(instance, value);
     }
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     void setup() throws Exception {
 
         // Start local bookkeeper ensemble
@@ -189,7 +189,7 @@ public class ModularLoadManagerImplTest {
         Thread.sleep(100);
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     void shutdown() throws Exception {
         log.info("--- Shutting down ---");
         executor.shutdown();
@@ -218,7 +218,7 @@ public class ModularLoadManagerImplTest {
     }
 
     // Test disabled since it's depending on CPU usage in the machine
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testCandidateConsistency() throws Exception {
         boolean foundFirst = false;
         boolean foundSecond = false;
@@ -257,7 +257,7 @@ public class ModularLoadManagerImplTest {
     // Test that bundles belonging to the same namespace are distributed evenly among brokers.
 
     // Test disabled since it's depending on CPU usage in the machine
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testEvenBundleDistribution() throws Exception {
         final NamespaceBundle[] bundles = LoadBalancerTestingUtils.makeBundles(nsFactory, "test", "test", "test", 16);
         int numAssignedToPrimary = 0;
@@ -298,7 +298,7 @@ public class ModularLoadManagerImplTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMaxTopicDistributionToBroker() throws Exception {
 
         final int totalBundles = 50;
@@ -321,7 +321,7 @@ public class ModularLoadManagerImplTest {
     }
 
     // Test that load shedding works
-    @Test
+    @Test(timeOut = 10000)
     public void testLoadShedding() throws Exception {
         final NamespaceBundleStats stats1 = new NamespaceBundleStats();
         final NamespaceBundleStats stats2 = new NamespaceBundleStats();
@@ -374,7 +374,7 @@ public class ModularLoadManagerImplTest {
     // Test that ModularLoadManagerImpl will determine that writing local data to ZooKeeper is necessary if certain
     // metrics change by a percentage threshold.
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNeedBrokerDataUpdate() throws Exception {
         final LocalBrokerData lastData = new LocalBrokerData();
         final LocalBrokerData currentData = new LocalBrokerData();
@@ -458,7 +458,7 @@ public class ModularLoadManagerImplTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokerStopCacheUpdate() throws Exception {
         String secondaryBroker = pulsar2.getAdvertisedAddress() + ":" + SECONDARY_BROKER_WEBSERVICE_PORT;
         pulsar2.getLocalZkCache().getZooKeeper().delete(LoadManager.LOADBALANCE_BROKERS_ROOT + "/" + secondaryBroker,
@@ -490,7 +490,7 @@ public class ModularLoadManagerImplTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testNamespaceIsolationPoliciesForPrimaryAndSecondaryBrokers() throws Exception {
 
         final String tenant = "my-property";
@@ -594,7 +594,7 @@ public class ModularLoadManagerImplTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testOwnBrokerZnodeByMultipleBroker() throws Exception {
 
         ServiceConfiguration config = new ServiceConfiguration();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/ModularLoadManagerStrategyTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/ModularLoadManagerStrategyTest.java
index 10488c4..2388cc4 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/ModularLoadManagerStrategyTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/ModularLoadManagerStrategyTest.java
@@ -34,7 +34,7 @@ import org.testng.annotations.Test;
 
 public class ModularLoadManagerStrategyTest {
     // Test that least long term message rate works correctly.
-    @Test
+    @Test(timeOut = 10000)
     public void testLeastLongTermMessageRate() {
         BundleData bundleData = new BundleData();
         BrokerData brokerData1 = initBrokerData();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/SimpleLoadManagerImplTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/SimpleLoadManagerImplTest.java
index 20d1926..d7c6519 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/SimpleLoadManagerImplTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/SimpleLoadManagerImplTest.java
@@ -123,7 +123,7 @@ public class SimpleLoadManagerImplTest {
         System.setProperty("test.basePort", "16100");
     }
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     void setup() throws Exception {
 
         // Start local bookkeeper ensemble
@@ -166,7 +166,7 @@ public class SimpleLoadManagerImplTest {
         Thread.sleep(100);
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     void shutdown() throws Exception {
         log.info("--- Shutting down ---");
         executor.shutdown();
@@ -206,7 +206,7 @@ public class SimpleLoadManagerImplTest {
 
     }
 
-    @Test(enabled = true)
+    @Test(timeOut = 10000)
     public void testBasicBrokerSelection() throws Exception {
         LoadManager loadManager = new SimpleLoadManagerImpl(pulsar1);
         PulsarResourceDescription rd = new PulsarResourceDescription();
@@ -240,7 +240,7 @@ public class SimpleLoadManagerImplTest {
         field.set(objInstance, newValue);
     }
 
-    @Test(enabled = true)
+    @Test(timeOut = 10000, enabled = true)
     public void testPrimary() throws Exception {
         createNamespacePolicies(pulsar1);
         LoadManager loadManager = new SimpleLoadManagerImpl(pulsar1);
@@ -280,7 +280,7 @@ public class SimpleLoadManagerImplTest {
 
     }
 
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testPrimarySecondary() throws Exception {
         createNamespacePolicies(pulsar1);
         LocalZooKeeperCache mockCache = mock(LocalZooKeeperCache.class);
@@ -336,7 +336,7 @@ public class SimpleLoadManagerImplTest {
         zkCacheField.set(pulsar1, originalLZK1);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testResourceDescription() {
 
         PulsarResourceDescription rd = new PulsarResourceDescription();
@@ -360,7 +360,7 @@ public class SimpleLoadManagerImplTest {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testLoadReportParsing() throws Exception {
 
         ObjectMapper mapper = ObjectMapperFactory.create();
@@ -380,7 +380,7 @@ public class SimpleLoadManagerImplTest {
                 0);
     }
 
-    @Test(enabled = true)
+    @Test(timeOut = 10000)
     public void testDoLoadShedding() throws Exception {
         LoadManager loadManager = spy(new SimpleLoadManagerImpl(pulsar1));
         PulsarResourceDescription rd = new PulsarResourceDescription();
@@ -429,7 +429,7 @@ public class SimpleLoadManagerImplTest {
     }
 
     // Test that bundles belonging to the same namespace are evenly distributed.
-    @Test
+    @Test(timeOut = 10000)
     public void testEvenBundleDistribution() throws Exception {
         final NamespaceBundle[] bundles = LoadBalancerTestingUtils
                 .makeBundles(pulsar1.getNamespaceService().getNamespaceBundleFactory(), "pulsar", "use", "test", 16);
@@ -459,7 +459,7 @@ public class SimpleLoadManagerImplTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNamespaceBundleStats() {
         NamespaceBundleStats nsb1 = new NamespaceBundleStats();
         nsb1.msgRateOut = 10000;
@@ -485,7 +485,7 @@ public class SimpleLoadManagerImplTest {
         assertEquals(-1, nsb1.compareByBandwidthIn(nsb2));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokerHostUsage() {
         BrokerHostUsage brokerUsage;
         if (SystemUtils.IS_OS_LINUX) {
@@ -497,7 +497,7 @@ public class SimpleLoadManagerImplTest {
         // Ok
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTask() throws Exception {
         LoadManager loadManager = mock(LoadManager.class);
         AtomicReference<LoadManager> atomicLoadManager = new AtomicReference<>(loadManager);
@@ -510,7 +510,7 @@ public class SimpleLoadManagerImplTest {
         verify(loadManager, times(1)).doLoadShedding();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUsage() {
         Map<String, Object> metrics = Maps.newHashMap();
         metrics.put("brk_conn_cnt", new Long(1));
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/impl/OverloadShedderTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/impl/OverloadShedderTest.java
index 7b0df5d..972c04f 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/impl/OverloadShedderTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/loadbalance/impl/OverloadShedderTest.java
@@ -45,13 +45,13 @@ public class OverloadShedderTest {
         conf.setLoadBalancerBrokerOverloadedThresholdPercentage(85);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNoBrokers() {
         LoadData loadData = new LoadData();
         assertTrue(os.findBundlesForUnloading(loadData, conf).isEmpty());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokersWithNoBundles() {
         LoadData loadData = new LoadData();
 
@@ -63,7 +63,7 @@ public class OverloadShedderTest {
         assertTrue(os.findBundlesForUnloading(loadData, conf).isEmpty());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokerNotOverloaded() {
         LoadData loadData = new LoadData();
 
@@ -84,7 +84,7 @@ public class OverloadShedderTest {
         assertTrue(os.findBundlesForUnloading(loadData, conf).isEmpty());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokerWithSingleBundle() {
         LoadData loadData = new LoadData();
 
@@ -105,7 +105,7 @@ public class OverloadShedderTest {
         assertTrue(os.findBundlesForUnloading(loadData, conf).isEmpty());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokerWithMultipleBundles() {
         int numBundles = 10;
         LoadData loadData = new LoadData();
@@ -141,7 +141,7 @@ public class OverloadShedderTest {
         assertEquals(bundlesToUnload.get("broker-1"), Lists.newArrayList("bundle-10", "bundle-9"));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testFilterRecentlyUnloaded() {
         int numBundles = 10;
         LoadData loadData = new LoadData();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/lookup/http/HttpTopicLookupv2Test.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/lookup/http/HttpTopicLookupv2Test.java
index 7089a4c..5caa196 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/lookup/http/HttpTopicLookupv2Test.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/lookup/http/HttpTopicLookupv2Test.java
@@ -79,7 +79,7 @@ public class HttpTopicLookupv2Test {
     private Set<String> clusters;
 
     @SuppressWarnings("unchecked")
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void setUp() throws Exception {
         pulsar = mock(PulsarService.class);
         ns = mock(NamespaceService.class);
@@ -116,7 +116,7 @@ public class HttpTopicLookupv2Test {
         doReturn(new Semaphore(1000)).when(brokerService).getLookupRequestSemaphore();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void crossColoLookup() throws Exception {
 
         TopicLookup destLookup = spy(new TopicLookup());
@@ -143,7 +143,7 @@ public class HttpTopicLookupv2Test {
     }
     
     
-    @Test
+    @Test(timeOut = 10000)
     public void testNotEnoughLookupPermits() throws Exception {
 
         BrokerService brokerService = pulsar.getBrokerService();
@@ -172,7 +172,7 @@ public class HttpTopicLookupv2Test {
         assertEquals(wae.getResponse().getStatus(), Status.SERVICE_UNAVAILABLE.getStatusCode());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testValidateReplicationSettingsOnNamespace() throws Exception {
 
         final String property = "my-prop";
@@ -215,7 +215,7 @@ public class HttpTopicLookupv2Test {
         assertEquals(arg2.getValue().getClass(), RestException.class);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDataPojo() {
         final String url = "localhost:8080";
         NamespaceData data1 = new NamespaceData(url);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceCreateBundlesTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceCreateBundlesTest.java
index 44a57b7..7266fe6 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceCreateBundlesTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceCreateBundlesTest.java
@@ -28,20 +28,20 @@ import org.testng.annotations.Test;
 
 public class NamespaceCreateBundlesTest extends BrokerTestBase {
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         conf.setDefaultNumberOfNamespaceBundles(16);
         super.baseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCreateNamespaceWithDefaultBundles() throws Exception {
         String namespaceName = "prop/default-bundles";
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceServiceTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceServiceTest.java
index cade6ed..5870e83 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceServiceTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceServiceTest.java
@@ -83,19 +83,19 @@ import org.testng.annotations.Test;
 
 public class NamespaceServiceTest extends BrokerTestBase {
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSplitAndOwnBundles() throws Exception {
 
         OwnershipCache MockOwnershipCache = spy(pulsar.getNamespaceService().getOwnershipCache());
@@ -160,7 +160,7 @@ public class NamespaceServiceTest extends BrokerTestBase {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSplitMapWithRefreshedStatMap() throws Exception {
 
         OwnershipCache MockOwnershipCache = spy(pulsar.getNamespaceService().getOwnershipCache());
@@ -210,7 +210,7 @@ public class NamespaceServiceTest extends BrokerTestBase {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testIsServiceUnitDisabled() throws Exception {
 
         OwnershipCache MockOwnershipCache = spy(pulsar.getNamespaceService().getOwnershipCache());
@@ -233,7 +233,7 @@ public class NamespaceServiceTest extends BrokerTestBase {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testremoveOwnershipNamespaceBundle() throws Exception {
 
         OwnershipCache ownershipCache = spy(pulsar.getNamespaceService().getOwnershipCache());
@@ -257,7 +257,7 @@ public class NamespaceServiceTest extends BrokerTestBase {
         assertNull(ownershipCache.getOwnedBundle(bundle));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUnloadNamespaceBundleFailure() throws Exception {
 
         final String topicName = "persistent://my-property/use/my-ns/my-topic1";
@@ -340,7 +340,7 @@ public class NamespaceServiceTest extends BrokerTestBase {
      * </pre>
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testLoadReportDeserialize() throws Exception {
 
         final String candidateBroker1 = "http://localhost:8000";
@@ -367,7 +367,7 @@ public class NamespaceServiceTest extends BrokerTestBase {
         System.out.println(result2);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCreateNamespaceWithDefaultNumberOfBundles() throws Exception {
         OwnershipCache MockOwnershipCache = spy(pulsar.getNamespaceService().getOwnershipCache());
         doNothing().when(MockOwnershipCache).disableOwnership(any(NamespaceBundle.class));
@@ -431,7 +431,7 @@ public class NamespaceServiceTest extends BrokerTestBase {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testRemoveOwnershipAndSplitBundle() throws Exception {
         OwnershipCache ownershipCache = spy(pulsar.getNamespaceService().getOwnershipCache());
         doNothing().when(ownershipCache).disableOwnership(any(NamespaceBundle.class));
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceUnloadingTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceUnloadingTest.java
index 855d53a..5f9e878 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceUnloadingTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/NamespaceUnloadingTest.java
@@ -30,19 +30,19 @@ import org.testng.annotations.Test;
 
 public class NamespaceUnloadingTest extends BrokerTestBase {
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUnloadNotLoadedNamespace() throws Exception {
         admin.namespaces().createNamespace("prop/ns-test-1");
         admin.namespaces().setNamespaceReplicationClusters("prop/ns-test-1", Sets.newHashSet("test"));
@@ -52,7 +52,7 @@ public class NamespaceUnloadingTest extends BrokerTestBase {
         admin.namespaces().unload("prop/ns-test-1");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUnloadPartiallyLoadedNamespace() throws Exception {
         admin.namespaces().createNamespace("prop/ns-test-2", 16);
         admin.namespaces().setNamespaceReplicationClusters("prop/ns-test-2", Sets.newHashSet("test"));
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/OwnershipCacheTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/OwnershipCacheTest.java
index 50b5395..ce9f272 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/OwnershipCacheTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/namespace/OwnershipCacheTest.java
@@ -69,7 +69,7 @@ public class OwnershipCacheTest {
     private BrokerService brokerService;
     private OrderedScheduler executor;
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void setup() throws Exception {
         final int port = 8080;
         selfBrokerUrl = "tcp://localhost:" + port;
@@ -99,19 +99,19 @@ public class OwnershipCacheTest {
         doReturn(selfBrokerUrl).when(pulsar).getSafeBrokerServiceUrl();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     public void teardown() throws Exception {
         executor.shutdown();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testConstructor() {
         OwnershipCache cache = new OwnershipCache(this.pulsar, bundleFactory);
         assertNotNull(cache);
         assertNotNull(cache.getOwnedBundles());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDisableOwnership() throws Exception {
         OwnershipCache cache = new OwnershipCache(this.pulsar, bundleFactory);
 
@@ -127,7 +127,7 @@ public class OwnershipCacheTest {
         assertTrue(data1.isDisabled());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetOrSetOwner() throws Exception {
         OwnershipCache cache = new OwnershipCache(this.pulsar, bundleFactory);
         NamespaceBundle testFullBundle = bundleFactory.getFullBundle(NamespaceName.get("pulsar/test/ns-2"));
@@ -158,7 +158,7 @@ public class OwnershipCacheTest {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetOwner() throws Exception {
         OwnershipCache cache = new OwnershipCache(this.pulsar, bundleFactory);
         NamespaceBundle testBundle = bundleFactory.getFullBundle(NamespaceName.get("pulsar/test/ns-3"));
@@ -186,7 +186,7 @@ public class OwnershipCacheTest {
         assertFalse(res.isPresent());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetOwnedServiceUnit() throws Exception {
         OwnershipCache cache = new OwnershipCache(this.pulsar, bundleFactory);
         NamespaceName testNs = NamespaceName.get("pulsar/test/ns-5");
@@ -235,7 +235,7 @@ public class OwnershipCacheTest {
         assertNotNull(cache.getOwnedBundle(testBundle));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetOwnedServiceUnits() throws Exception {
         OwnershipCache cache = new OwnershipCache(this.pulsar, bundleFactory);
         NamespaceName testNs = NamespaceName.get("pulsar/test/ns-6");
@@ -270,7 +270,7 @@ public class OwnershipCacheTest {
         assertEquals(cache.getOwnedBundles().size(), 1);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testRemoveOwnership() throws Exception {
         OwnershipCache cache = new OwnershipCache(this.pulsar, bundleFactory);
         NamespaceName testNs = NamespaceName.get("pulsar/test/ns-7");
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/AdvertisedAddressTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/AdvertisedAddressTest.java
index 988c65a..87a3ae8 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/AdvertisedAddressTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/AdvertisedAddressTest.java
@@ -45,7 +45,7 @@ public class AdvertisedAddressTest {
 
     private final String advertisedAddress = "pulsar-usc.example.com";
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void setup() throws Exception {
         bkEnsemble = new LocalBookkeeperEnsemble(3, ZOOKEEPER_PORT, () -> PortManager.nextFreePort());
         bkEnsemble.start();
@@ -62,13 +62,13 @@ public class AdvertisedAddressTest {
         pulsar.start();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     public void shutdown() throws Exception {
         pulsar.close();
         bkEnsemble.stop();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAdvertisedAddress() throws Exception {
         Assert.assertEquals( pulsar.getAdvertisedAddress(), advertisedAddress );
         Assert.assertEquals( pulsar.getSafeBrokerServiceUrl(), String.format("pulsar://%s:%d", advertisedAddress, BROKER_SERVICE_PORT) );
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java
index 2268d5c..65aa01e 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java
@@ -69,11 +69,11 @@ public class BacklogQuotaManagerTest {
     protected final int BROKER_WEBSERVICE_PORT = PortManager.nextFreePort();
     private static final int TIME_TO_CHECK_BACKLOG_QUOTA = 5;
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     void setup() throws Exception {
         try {
             // start local bookie and zookeeper
-            bkEnsemble = new LocalBookkeeperEnsemble(3, ZOOKEEPER_PORT, () -> PortManager.nextFreePort());
+            bkEnsemble = new LocalBookkeeperEnsemble(3, ZOOKEEPER_PORT, PortManager::nextFreePort);
             bkEnsemble.start();
 
             // start pulsar service
@@ -110,7 +110,7 @@ public class BacklogQuotaManagerTest {
         }
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     void shutdown() throws Exception {
         try {
             admin.close();
@@ -126,7 +126,7 @@ public class BacklogQuotaManagerTest {
         pulsar.getBrokerService().updateRates();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testConsumerBacklogEviction() throws Exception {
         assertEquals(admin.namespaces().getBacklogQuotaMap("prop/ns-quota"),
                 ConfigHelper.backlogQuotaMap(config));
@@ -158,7 +158,7 @@ public class BacklogQuotaManagerTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testConsumerBacklogEvictionWithAck() throws Exception {
         assertEquals(admin.namespaces().getBacklogQuotaMap("prop/ns-quota"),
                 ConfigHelper.backlogQuotaMap(config));
@@ -190,7 +190,7 @@ public class BacklogQuotaManagerTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testConcurrentAckAndEviction() throws Exception {
         assertEquals(admin.namespaces().getBacklogQuotaMap("prop/ns-quota"),
                 ConfigHelper.backlogQuotaMap(config));
@@ -263,7 +263,7 @@ public class BacklogQuotaManagerTest {
         client2.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNoEviction() throws Exception {
         assertEquals(admin.namespaces().getBacklogQuotaMap("prop/ns-quota"),
                 ConfigHelper.backlogQuotaMap(config));
@@ -329,7 +329,7 @@ public class BacklogQuotaManagerTest {
         client2.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testEvictionMulti() throws Exception {
         assertEquals(admin.namespaces().getBacklogQuotaMap("prop/ns-quota"),
                 ConfigHelper.backlogQuotaMap(config));
@@ -438,7 +438,7 @@ public class BacklogQuotaManagerTest {
         client3.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAheadProducerOnHold() throws Exception {
         assertEquals(admin.namespaces().getBacklogQuotaMap("prop/quotahold"),
                 ConfigHelper.backlogQuotaMap(config));
@@ -477,7 +477,7 @@ public class BacklogQuotaManagerTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAheadProducerOnHoldTimeout() throws Exception {
         assertEquals(admin.namespaces().getBacklogQuotaMap("prop/quotahold"),
                 ConfigHelper.backlogQuotaMap(config));
@@ -512,7 +512,7 @@ public class BacklogQuotaManagerTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProducerException() throws Exception {
         assertEquals(admin.namespaces().getBacklogQuotaMap("prop/quotahold"),
                 ConfigHelper.backlogQuotaMap(config));
@@ -549,7 +549,7 @@ public class BacklogQuotaManagerTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testProducerExceptionAndThenUnblock() throws Exception {
         assertEquals(admin.namespaces().getBacklogQuotaMap("prop/quotahold"),
                 ConfigHelper.backlogQuotaMap(config));
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BatchMessageTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BatchMessageTest.java
index 463837d..f692c7b 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BatchMessageTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BatchMessageTest.java
@@ -60,13 +60,13 @@ import org.testng.annotations.Test;
 
 public class BatchMessageTest extends BrokerTestBase {
 
-    @BeforeClass
+    @BeforeClass(timeOut = 60000)
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterClass
+    @AfterClass(timeOut = 60000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -92,7 +92,7 @@ public class BatchMessageTest extends BrokerTestBase {
         };
     }
 
-    @Test(dataProvider = "codecAndContainerBuilder")
+    @Test(timeOut = 10000, dataProvider = "codecAndContainerBuilder")
     public void testSimpleBatchProducerWithFixedBatchSize(CompressionType compressionType, BatcherBuilder builder) throws Exception {
         int numMsgs = 50;
         int numMsgsInBatch = numMsgs / 2;
@@ -136,7 +136,7 @@ public class BatchMessageTest extends BrokerTestBase {
         producer.close();
     }
 
-    @Test(dataProvider = "codecAndContainerBuilder")
+    @Test(timeOut = 10000, dataProvider = "codecAndContainerBuilder")
     public void testSimpleBatchProducerWithFixedBatchTime(CompressionType compressionType, BatcherBuilder builder) throws Exception {
         int numMsgs = 100;
         final String topicName = "persistent://prop/ns-abc/testSimpleBatchProducerWithFixedBatchTime-" + UUID.randomUUID();
@@ -172,7 +172,7 @@ public class BatchMessageTest extends BrokerTestBase {
         producer.close();
     }
 
-    @Test(dataProvider = "codecAndContainerBuilder")
+    @Test(timeOut = 10000, dataProvider = "codecAndContainerBuilder")
     public void testSimpleBatchProducerWithFixedBatchSizeAndTime(CompressionType compressionType, BatcherBuilder builder) throws Exception {
         int numMsgs = 100;
         final String topicName = "persistent://prop/ns-abc/testSimpleBatchProducerWithFixedBatchSizeAndTime-" + UUID.randomUUID();
@@ -208,7 +208,7 @@ public class BatchMessageTest extends BrokerTestBase {
         producer.close();
     }
 
-    @Test(dataProvider = "codecAndContainerBuilder")
+    @Test(timeOut = 10000, dataProvider = "codecAndContainerBuilder")
     public void testBatchProducerWithLargeMessage(CompressionType compressionType, BatcherBuilder builder) throws Exception {
         int numMsgs = 50;
         int numMsgsInBatch = numMsgs / 2;
@@ -261,7 +261,7 @@ public class BatchMessageTest extends BrokerTestBase {
         producer.close();
     }
 
-    @Test(dataProvider = "codecAndContainerBuilder")
+    @Test(timeOut = 10000, dataProvider = "codecAndContainerBuilder")
     public void testSimpleBatchProducerConsumer(CompressionType compressionType, BatcherBuilder builder) throws Exception {
         int numMsgs = 500;
         int numMsgsInBatch = numMsgs / 20;
@@ -320,7 +320,7 @@ public class BatchMessageTest extends BrokerTestBase {
         producer.close();
     }
 
-    @Test(dataProvider = "containerBuilder")
+    @Test(timeOut = 10000, dataProvider = "containerBuilder")
     public void testSimpleBatchSyncProducerWithFixedBatchSize(BatcherBuilder builder) throws Exception {
         int numMsgs = 10;
         int numMsgsInBatch = numMsgs / 2;
@@ -363,7 +363,7 @@ public class BatchMessageTest extends BrokerTestBase {
 
     }
 
-    @Test(dataProvider = "containerBuilder")
+    @Test(timeOut = 10000, dataProvider = "containerBuilder")
     public void testSimpleBatchProducerConsumer1kMessages(BatcherBuilder builder) throws Exception {
         int numMsgs = 2000;
         int numMsgsInBatch = 4;
@@ -426,7 +426,7 @@ public class BatchMessageTest extends BrokerTestBase {
      * on broker) individual ack on 6-10. (if ack type individual on bid 5, then hole remains which is ok) 0 2 1-10 0 3
      * 1-10
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testOutOfOrderAcksForBatchMessage() throws Exception {
         int numMsgs = 40;
         int numMsgsInBatch = numMsgs / 4;
@@ -491,7 +491,7 @@ public class BatchMessageTest extends BrokerTestBase {
         producer.close();
     }
 
-    @Test(dataProvider = "containerBuilder")
+    @Test(timeOut = 10000, dataProvider = "containerBuilder")
     public void testNonBatchCumulativeAckAfterBatchPublish(BatcherBuilder builder) throws Exception {
         int numMsgs = 10;
         int numMsgsInBatch = numMsgs;
@@ -544,7 +544,7 @@ public class BatchMessageTest extends BrokerTestBase {
         noBatchProducer.close();
     }
 
-    @Test(dataProvider = "containerBuilder")
+    @Test(timeOut = 10000, dataProvider = "containerBuilder")
     public void testBatchAndNonBatchCumulativeAcks(BatcherBuilder builder) throws Exception {
         int numMsgs = 50;
         int numMsgsInBatch = numMsgs / 10;
@@ -673,7 +673,7 @@ public class BatchMessageTest extends BrokerTestBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOrderingOfKeyBasedBatchMessageContainer() throws PulsarClientException, ExecutionException, InterruptedException {
         final String topicName = "persistent://prop/ns-abc/testKeyBased";
         final String subscriptionName = "sub-1";
@@ -737,7 +737,7 @@ public class BatchMessageTest extends BrokerTestBase {
         producer.close();
     }
 
-    @Test(dataProvider = "containerBuilder")
+    @Test(timeOut = 10000, dataProvider = "containerBuilder")
     private void testRetrieveSequenceIdGenerated(BatcherBuilder builder) throws Exception {
 
         int numMsgs = 10;
@@ -769,7 +769,7 @@ public class BatchMessageTest extends BrokerTestBase {
         consumer.close();
     }
 
-    @Test(dataProvider = "containerBuilder")
+    @Test(timeOut = 10000, dataProvider = "containerBuilder")
     private void testRetrieveSequenceIdSpecify(BatcherBuilder builder) throws Exception {
 
         int numMsgs = 10;
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerBkEnsemblesTests.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerBkEnsemblesTests.java
index 940002d..1bd73d4 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerBkEnsemblesTests.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerBkEnsemblesTests.java
@@ -83,7 +83,7 @@ public class BrokerBkEnsemblesTests {
         this.numberOfBookies = numberOfBookies;
     }
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     protected void setup() throws Exception {
         try {
             int ZOOKEEPER_PORT = PortManager.nextFreePort();
@@ -120,7 +120,7 @@ public class BrokerBkEnsemblesTests {
         }
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     protected void shutdown() throws Exception {
         try {
             admin.close();
@@ -145,7 +145,7 @@ public class BrokerBkEnsemblesTests {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testCrashBrokerWithoutCursorLedgerLeak() throws Exception {
 
         ZooKeeper zk = bkEnsemble.getZkClient();
@@ -238,7 +238,7 @@ public class BrokerBkEnsemblesTests {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testSkipCorruptDataLedger() throws Exception {
         // Ensure intended state for autoSkipNonRecoverableData
         admin.brokers().updateDynamicConfiguration("autoSkipNonRecoverableData", "false");
@@ -342,7 +342,7 @@ public class BrokerBkEnsemblesTests {
         client.close();
     }
 
-    @Test(timeOut=20000)
+    @Test(timeOut = 20000)
     public void testTopicWithWildCardChar() throws Exception {
         PulsarClient client = PulsarClient.builder().serviceUrl(adminUrl.toString()).statsInterval(0, TimeUnit.SECONDS)
                 .build();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerBookieIsolationTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerBookieIsolationTest.java
index 3b9edc9..1d396c0 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerBookieIsolationTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerBookieIsolationTest.java
@@ -92,14 +92,14 @@ public class BrokerBookieIsolationTest {
 
     private final ObjectMapper jsonMapper = ObjectMapperFactory.create();
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     protected void setup() throws Exception {
         // Start local bookkeeper ensemble
         bkEnsemble = new LocalBookkeeperEnsemble(4, ZOOKEEPER_PORT, () -> PortManager.nextFreePort());
         bkEnsemble.start();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     protected void cleanup() throws Exception {
         if (pulsarService != null) {
             pulsarService.close();
@@ -120,7 +120,7 @@ public class BrokerBookieIsolationTest {
      * 
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testBookieIsolation() throws Exception {
 
         final String tenant1 = "tenant1";
@@ -247,7 +247,7 @@ public class BrokerBookieIsolationTest {
      * 
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testBookieIsilationWithSecondaryGroup() throws Exception {
         final String tenant1 = "tenant1";
         final String cluster = "use";
@@ -373,7 +373,7 @@ public class BrokerBookieIsolationTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDeleteIsolationGroup() throws Exception {
 
         final String tenant1 = "tenant1";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceTest.java
index d0d5c28..a7f6e04 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceTest.java
@@ -87,19 +87,19 @@ public class BrokerServiceTest extends BrokerTestBase {
     private final String TLS_CLIENT_CERT_FILE_PATH = "./src/test/resources/certificate/client.crt";
     private final String TLS_CLIENT_KEY_FILE_PATH = "./src/test/resources/certificate/client.key";
 
-    @BeforeClass
+    @BeforeClass(timeOut = 60000)
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterClass
+    @AfterClass(timeOut = 60000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOwnedNsCheck() throws Exception {
         final String topic = "persistent://prop/ns-abc/successTopic";
         BrokerService service = pulsar.getBrokerService();
@@ -133,7 +133,7 @@ public class BrokerServiceTest extends BrokerTestBase {
         latch2.await();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokerServicePersistentTopicStats() throws Exception {
         final String topicName = "persistent://prop/ns-abc/successTopic";
         final String subName = "successSub";
@@ -210,7 +210,7 @@ public class BrokerServiceTest extends BrokerTestBase {
         assertEquals(subStats.msgBacklog, 0);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokerServicePersistentRedeliverTopicStats() throws Exception {
         final String topicName = "persistent://prop/ns-abc/successSharedTopic";
         final String subName = "successSharedSub";
@@ -299,7 +299,7 @@ public class BrokerServiceTest extends BrokerTestBase {
         assertEquals(subStats.msgBacklog, 0);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokerStatsMetrics() throws Exception {
         final String topicName = "persistent://prop/ns-abc/newTopic";
         final String subName = "newSub";
@@ -347,7 +347,7 @@ public class BrokerServiceTest extends BrokerTestBase {
         Thread.sleep(ASYNC_EVENT_COMPLETION_WAIT);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokerServiceNamespaceStats() throws Exception {
         final int numBundles = 4;
         final String ns1 = "prop/stats1";
@@ -401,7 +401,7 @@ public class BrokerServiceTest extends BrokerTestBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTlsDisabled() throws Exception {
         final String topicName = "persistent://prop/ns-abc/newTopic";
         final String subName = "newSub";
@@ -440,7 +440,7 @@ public class BrokerServiceTest extends BrokerTestBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTlsEnabled() throws Exception {
         final String topicName = "persistent://prop/ns-abc/newTopic";
         final String subName = "newSub";
@@ -514,7 +514,7 @@ public class BrokerServiceTest extends BrokerTestBase {
     }
 
     @SuppressWarnings("deprecation")
-    @Test
+    @Test(timeOut = 10000)
     public void testTlsAuthAllowInsecure() throws Exception {
         final String topicName = "persistent://prop/ns-abc/newTopic";
         final String subName = "newSub";
@@ -574,7 +574,7 @@ public class BrokerServiceTest extends BrokerTestBase {
     }
 
     @SuppressWarnings("deprecation")
-    @Test
+    @Test(timeOut = 10000)
     public void testTlsAuthDisallowInsecure() throws Exception {
         final String topicName = "persistent://prop/my-ns/newTopic";
         final String subName = "newSub";
@@ -633,7 +633,7 @@ public class BrokerServiceTest extends BrokerTestBase {
     }
 
     @SuppressWarnings("deprecation")
-    @Test
+    @Test(timeOut = 10000)
     public void testTlsAuthUseTrustCert() throws Exception {
         final String topicName = "persistent://prop/ns-abc/newTopic";
         final String subName = "newSub";
@@ -695,7 +695,7 @@ public class BrokerServiceTest extends BrokerTestBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testLookupThrottlingForClientByClient() throws Exception {
         final String topicName = "persistent://prop/ns-abc/newTopic";
 
@@ -732,7 +732,7 @@ public class BrokerServiceTest extends BrokerTestBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTopicLoadingOnDisableNamespaceBundle() throws Exception {
         final String namespace = "prop/disableBundle";
         admin.namespaces().createNamespace(namespace);
@@ -811,7 +811,7 @@ public class BrokerServiceTest extends BrokerTestBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testLedgerOpenFailureShouldNotHaveDeadLock() throws Exception {
         final String namespace = "prop/ns-abc";
         final String deadLockTestTopic = "persistent://" + namespace + "/deadLockTestTopic";
@@ -869,7 +869,7 @@ public class BrokerServiceTest extends BrokerTestBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testCreateNamespacePolicy() throws Exception {
         final String namespace = "prop/testPolicy";
         final int totalBundle = 3;
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceThrottlingTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceThrottlingTest.java
index 0ae6c91..8c50710 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceThrottlingTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BrokerServiceThrottlingTest.java
@@ -52,13 +52,13 @@ import com.google.common.collect.Maps;
  */
 public class BrokerServiceThrottlingTest extends BrokerTestBase {
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -69,7 +69,7 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testThrottlingLookupRequestSemaphore() throws Exception {
         BrokerService service = pulsar.getBrokerService();
         assertNotEquals(service.lookupRequestSemaphore.get().availablePermits(), 0);
@@ -84,7 +84,7 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testLookupThrottlingForClientByBroker0Permit() throws Exception {
 
         final String topicName = "persistent://prop/ns-abc/newTopic";
@@ -126,7 +126,7 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testLookupThrottlingForClientByBroker() throws Exception {
         final String topicName = "persistent://prop/ns-abc/newTopic";
 
@@ -187,7 +187,7 @@ public class BrokerServiceThrottlingTest extends BrokerTestBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testLookupThrottlingForClientByBrokerInternalRetry() throws Exception {
 
         final String topicName = "persistent://prop/ns-abc/newTopic";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/DistributedIdGeneratorTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/DistributedIdGeneratorTest.java
index 5d2d032..841db9c 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/DistributedIdGeneratorTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/DistributedIdGeneratorTest.java
@@ -39,22 +39,22 @@ import org.testng.annotations.Test;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 
-@Test
+@Test(timeOut = 10000)
 public class DistributedIdGeneratorTest {
 
     private MockZooKeeper zkc;
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     public void setup() throws Exception {
         zkc = MockZooKeeper.newInstance();
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     public void teardown() throws Exception {
         zkc.shutdown();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void simple() throws Exception {
         DistributedIdGenerator gen1 = new DistributedIdGenerator(zkc, "/my/test/simple", "p");
 
@@ -74,7 +74,7 @@ public class DistributedIdGeneratorTest {
     /**
      * Use multiple threads to generate many Id. Ensure no holes and no dups in the sequence
      */
-    @Test
+    @Test(timeOut = 10000)
     public void concurrent() throws Exception {
         int Threads = 10;
         int Iterations = 100;
@@ -115,7 +115,7 @@ public class DistributedIdGeneratorTest {
         executor.shutdown();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void invalidZnode() throws Exception {
         zkc.create("/my/test/invalid", "invalid-number".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/HashRangeStickyKeyConsumerSelectorTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/HashRangeStickyKeyConsumerSelectorTest.java
index 0bc5fb3..ee63503 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/HashRangeStickyKeyConsumerSelectorTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/HashRangeStickyKeyConsumerSelectorTest.java
@@ -30,7 +30,7 @@ import java.util.UUID;
 
 public class HashRangeStickyKeyConsumerSelectorTest {
 
-    @Test
+    @Test(timeOut = 10000)
     public void testConsumerSelect() throws ConsumerAssignException {
 
         HashRangeStickyKeyConsumerSelector selector = new HashRangeStickyKeyConsumerSelector();
@@ -135,7 +135,7 @@ public class HashRangeStickyKeyConsumerSelectorTest {
         }
     }
 
-    @Test(expectedExceptions = ConsumerAssignException.class)
+    @Test(timeOut = 10000, expectedExceptions = ConsumerAssignException.class)
     public void testSplitExceed() throws ConsumerAssignException {
         StickyKeyConsumerSelector selector = new HashRangeStickyKeyConsumerSelector(16);
         for (int i = 0; i <= 16; i++) {
@@ -143,12 +143,12 @@ public class HashRangeStickyKeyConsumerSelectorTest {
         }
     }
 
-    @Test(expectedExceptions = IllegalArgumentException.class)
+    @Test(timeOut = 10000, expectedExceptions = IllegalArgumentException.class)
     public void testRangeSizeLessThan2() {
         new HashRangeStickyKeyConsumerSelector(1);
     }
 
-    @Test(expectedExceptions = IllegalArgumentException.class)
+    @Test(timeOut = 10000, expectedExceptions = IllegalArgumentException.class)
     public void testRangeSizePower2() {
         new HashRangeStickyKeyConsumerSelector(6);
     }
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/MaxMessageSizeTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/MaxMessageSizeTest.java
index 626da84..78eff52 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/MaxMessageSizeTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/MaxMessageSizeTest.java
@@ -51,7 +51,7 @@ public class MaxMessageSizeTest {
     private final int ZOOKEEPER_PORT = PortManager.nextFreePort();
     private final int BROKER_WEBSERVER_PORT = PortManager.nextFreePort();
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     void setup() {
         try {
             bkEnsemble = new LocalBookkeeperEnsemble(3, ZOOKEEPER_PORT, PortManager::nextFreePort);
@@ -85,7 +85,7 @@ public class MaxMessageSizeTest {
         }
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     void shutdown() {
         try {
             pulsar.close();
@@ -95,7 +95,7 @@ public class MaxMessageSizeTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMaxMessageSetting() throws PulsarClientException {
 
         PulsarClient client = PulsarClient.builder().serviceUrl("pulsar://127.0.0.1:" + BROKER_SERVICE_PORT).build();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/MessageIdSerialization.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/MessageIdSerialization.java
index 6f6e60e..c5b3ad3 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/MessageIdSerialization.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/MessageIdSerialization.java
@@ -26,29 +26,29 @@ import org.apache.pulsar.client.api.MessageId;
 import org.apache.pulsar.client.impl.MessageIdImpl;
 import org.testng.annotations.Test;
 
-@Test
+@Test(timeOut = 10000)
 public class MessageIdSerialization {
 
-    @Test
+    @Test(timeOut = 10000)
     void testProtobufSerialization1() throws Exception {
         MessageId id = new MessageIdImpl(1, 2, 3);
         byte[] serializedId = id.toByteArray();
         assertEquals(MessageId.fromByteArray(serializedId), id);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     void testProtobufSerialization2() throws Exception {
         MessageId id = new MessageIdImpl(1, 2, -1);
         byte[] serializedId = id.toByteArray();
         assertEquals(MessageId.fromByteArray(serializedId), id);
     }
 
-    @Test(expectedExceptions = NullPointerException.class)
+    @Test(timeOut = 10000, expectedExceptions = NullPointerException.class)
     void testProtobufSerializationNull() throws Exception {
         MessageId.fromByteArray(null);
     }
 
-    @Test(expectedExceptions = IOException.class)
+    @Test(timeOut = 10000, expectedExceptions = IOException.class)
     void testProtobufSerializationEmpty() throws Exception {
         MessageId.fromByteArray(new byte[0]);
     }
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/NonPersistentTopicE2ETest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/NonPersistentTopicE2ETest.java
index cd47559..3f16fc1 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/NonPersistentTopicE2ETest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/NonPersistentTopicE2ETest.java
@@ -40,16 +40,16 @@ import static org.testng.Assert.assertFalse;
 import static org.testng.Assert.assertTrue;
 
 
-@Test
+@Test(timeOut = 10000)
 public class NonPersistentTopicE2ETest extends BrokerTestBase {
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -75,7 +75,7 @@ public class NonPersistentTopicE2ETest extends BrokerTestBase {
         return result != null && !result.schema.isDeleted();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGCWillDeleteSchema() throws Exception {
         // 1. Simple successful GC
         String topicName = "non-persistent://prop/ns-abc/topic-1";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PartitionKeyTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PartitionKeyTest.java
index fce443b..5fea003 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PartitionKeyTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PartitionKeyTest.java
@@ -29,15 +29,15 @@ import org.testng.annotations.Test;
 
 /**
  */
-@Test
+@Test(timeOut = 10000)
 public class PartitionKeyTest extends BrokerTestBase {
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PeerReplicatorTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PeerReplicatorTest.java
index 2842934..c57cab8 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PeerReplicatorTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PeerReplicatorTest.java
@@ -48,13 +48,13 @@ import com.google.common.collect.Sets;
 public class PeerReplicatorTest extends ReplicatorTestBase {
 
     @Override
-    @BeforeClass(timeOut = 300000)
+    @BeforeClass( timeOut = 300000)
     void setup() throws Exception {
         super.setup();
     }
 
     @Override
-    @AfterClass(timeOut = 300000)
+    @AfterClass( timeOut = 300000)
     void shutdown() throws Exception {
         super.shutdown();
     }
@@ -186,7 +186,7 @@ public class PeerReplicatorTest extends ReplicatorTestBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testPeerClusterInReplicationClusterListChange() throws Exception {
 
         // clean up peer-clusters
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentDispatcherFailoverConsumerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentDispatcherFailoverConsumerTest.java
index 886018b..7afbb1c 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentDispatcherFailoverConsumerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentDispatcherFailoverConsumerTest.java
@@ -103,7 +103,7 @@ public class PersistentDispatcherFailoverConsumerTest {
     final String successTopicName = "persistent://part-perf/global/perf.t1/ptopic";
     final String failTopicName = "persistent://part-perf/global/perf.t1/pfailTopic";
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void setup() throws Exception {
         ServiceConfiguration svcConfig = spy(new ServiceConfiguration());
         PulsarService pulsar = spy(new PulsarService(svcConfig));
@@ -260,7 +260,7 @@ public class PersistentDispatcherFailoverConsumerTest {
         change.recycle();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testConsumerGroupChangesWithOldNewConsumers() throws Exception {
         PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
         PersistentSubscription sub = new PersistentSubscription(topic, "sub-1", cursorMock, false);
@@ -297,7 +297,7 @@ public class PersistentDispatcherFailoverConsumerTest {
         verify(channelCtx, times(1)).writeAndFlush(any(), any());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAddRemoveConsumer() throws Exception {
         log.info("--- Starting PersistentDispatcherFailoverConsumerTest::testAddConsumer ---");
 
@@ -417,7 +417,7 @@ public class PersistentDispatcherFailoverConsumerTest {
         assertTrue(pdfc.canUnsubscribe(consumer1));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAddRemoveConsumerNonPartitionedTopic() throws Exception {
         log.info("--- Starting PersistentDispatcherFailoverConsumerTest::testAddConsumer ---");
 
@@ -478,7 +478,7 @@ public class PersistentDispatcherFailoverConsumerTest {
         verify(consumer3, times(1)).notifyActiveConsumerChange(same(consumer2));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMultipleDispatcherGetNextConsumerWithDifferentPriorityLevel() throws Exception {
 
         PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
@@ -523,7 +523,7 @@ public class PersistentDispatcherFailoverConsumerTest {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testFewBlockedConsumerSamePriority() throws Exception{
         PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
         PersistentDispatcherMultipleConsumers dispatcher = new PersistentDispatcherMultipleConsumers(topic, cursorMock, null);
@@ -550,7 +550,7 @@ public class PersistentDispatcherFailoverConsumerTest {
         assertNull(getNextConsumer(dispatcher));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testFewBlockedConsumerDifferentPriority() throws Exception {
         PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
         PersistentDispatcherMultipleConsumers dispatcher = new PersistentDispatcherMultipleConsumers(topic, cursorMock, null);
@@ -604,7 +604,7 @@ public class PersistentDispatcherFailoverConsumerTest {
         assertNull(getNextConsumer(dispatcher));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testFewBlockedConsumerDifferentPriority2() throws Exception {
         PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
         PersistentDispatcherMultipleConsumers dispatcher = new PersistentDispatcherMultipleConsumers(topic, cursorMock, null);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentFailoverE2ETest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentFailoverE2ETest.java
index 9389c1a..8272f01 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentFailoverE2ETest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentFailoverE2ETest.java
@@ -58,13 +58,13 @@ import org.testng.annotations.Test;
 
 public class PersistentFailoverE2ETest extends BrokerTestBase {
 
-    @BeforeClass
+    @BeforeClass(timeOut = 60000)
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterClass
+    @AfterClass(timeOut = 60000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -131,7 +131,7 @@ public class PersistentFailoverE2ETest extends BrokerTestBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSimpleConsumerEventsWithoutPartition() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/failover-topic1";
         final String subName = "sub1";
@@ -259,7 +259,7 @@ public class PersistentFailoverE2ETest extends BrokerTestBase {
         admin.topics().delete(topicName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSimpleConsumerEventsWithPartition() throws Exception {
         int numPartitions = 4;
 
@@ -455,7 +455,7 @@ public class PersistentFailoverE2ETest extends BrokerTestBase {
         admin.topics().deletePartitionedTopic(topicName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testActiveConsumerFailoverWithDelay() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/failover-topic3";
         final String subName = "sub1";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentMessageFinderTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentMessageFinderTest.java
index 086c087..6759a43 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentMessageFinderTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentMessageFinderTest.java
@@ -112,7 +112,7 @@ public class PersistentMessageFinderTest extends MockedBookKeeperTestCase {
         return future;
     }
 
-    @Test
+    @Test(timeOut = 10000)
     void testPersistentMessageFinder() throws Exception {
         final String ledgerAndCursorName = "testPersistentMessageFinder";
         int entriesPerLedger = 2;
@@ -205,7 +205,7 @@ public class PersistentMessageFinderTest extends MockedBookKeeperTestCase {
      * 
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     void testMessageExpiryWithNonRecoverableException() throws Exception {
 
         final String ledgerAndCursorName = "testPersistentMessageExpiryWithNonRecoverableLedgers";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentQueueE2ETest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentQueueE2ETest.java
index e0ae197..b3cf692 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentQueueE2ETest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentQueueE2ETest.java
@@ -58,13 +58,13 @@ import com.google.common.collect.Lists;
  */
 public class PersistentQueueE2ETest extends BrokerTestBase {
 
-    @BeforeClass
+    @BeforeClass(timeOut = 60000)
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterClass
+    @AfterClass(timeOut = 60000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -80,7 +80,7 @@ public class PersistentQueueE2ETest extends BrokerTestBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSimpleConsumerEvents() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/shared-topic1";
         final String subName = "sub1";
@@ -181,7 +181,7 @@ public class PersistentQueueE2ETest extends BrokerTestBase {
         deleteTopic(topicName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReplayOnConsumerDisconnect() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/shared-topic3";
         final String subName = "sub3";
@@ -235,7 +235,7 @@ public class PersistentQueueE2ETest extends BrokerTestBase {
     // this test is good to have to see the distribution, but every now and then it gets slightly different than the
     // expected numbers. keeping this disabled to not break the build, but nevertheless this gives good insight into
     // how the round robin distribution algorithm is behaving
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testRoundRobinBatchDistribution() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/shared-topic5";
         final String subName = "sub5";
@@ -454,7 +454,7 @@ public class PersistentQueueE2ETest extends BrokerTestBase {
         assertEquals(receivedConsumer1, totalMessages);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUnackedCountWithRedeliveries() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/testUnackedCountWithRedeliveries";
         final String subName = "sub3";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicConcurrentTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicConcurrentTest.java
index e135785..d27d051 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicConcurrentTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicConcurrentTest.java
@@ -73,7 +73,7 @@ public class PersistentTopicConcurrentTest extends MockedBookKeeperTestCase {
     final String successSubName = "successSub";
     private static final Logger log = LoggerFactory.getLogger(PersistentTopicTest.class);
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void setup(Method m) throws Exception {
         super.setUp(m);
         ServiceConfiguration svcConfig = spy(new ServiceConfiguration());
@@ -111,7 +111,7 @@ public class PersistentTopicConcurrentTest extends MockedBookKeeperTestCase {
         }
     }
 
-    // @Test
+    // @Test(timeOut = 10000)
     public void testConcurrentTopicAndSubscriptionDelete() throws Exception {
         // create topic
         final PersistentTopic topic = (PersistentTopic) brokerService.getOrCreateTopic(successTopicName).get();
@@ -170,7 +170,7 @@ public class PersistentTopicConcurrentTest extends MockedBookKeeperTestCase {
         assertFalse(gotException.get());
     }
 
-    // @Test
+    // @Test(timeOut = 10000)
     public void testConcurrentTopicGCAndSubscriptionDelete() throws Exception {
         // create topic
         final PersistentTopic topic = (PersistentTopic) brokerService.getOrCreateTopic(successTopicName).get();
@@ -233,7 +233,7 @@ public class PersistentTopicConcurrentTest extends MockedBookKeeperTestCase {
         assertFalse(gotException.get());
     }
 
-    // @Test
+    // @Test(timeOut = 10000)
     public void testConcurrentTopicDeleteAndUnsubscribe() throws Exception {
         // create topic
         final PersistentTopic topic = (PersistentTopic) brokerService.getOrCreateTopic(successTopicName).get();
@@ -292,7 +292,7 @@ public class PersistentTopicConcurrentTest extends MockedBookKeeperTestCase {
         assertFalse(gotException.get());
     }
 
-    // @Test
+    // @Test(timeOut = 10000)
     public void testConcurrentTopicDeleteAndSubsUnsubscribe() throws Exception {
         // create topic
         final PersistentTopic topic = (PersistentTopic) brokerService.getOrCreateTopic(successTopicName).get();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicE2ETest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicE2ETest.java
index 38a080f..4665082 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicE2ETest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicE2ETest.java
@@ -85,21 +85,21 @@ import org.testng.annotations.Test;
 
 /**
  */
-@Test
+@Test(timeOut = 10000)
 public class PersistentTopicE2ETest extends BrokerTestBase {
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSimpleProducerEvents() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic0";
 
@@ -130,7 +130,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         assertEquals(topicRef.getProducers().size(), 0);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSimpleConsumerEvents() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic1";
         final String subName = "sub1";
@@ -217,7 +217,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         Thread.sleep(ASYNC_EVENT_COMPLETION_WAIT);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testConsumerFlowControl() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic2";
         final String subName = "sub2";
@@ -264,7 +264,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testActiveSubscriptionWithCache() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic2";
         final String subName = "sub2";
@@ -319,7 +319,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
 
     // some race conditions needs to be handled
     // disabling the test for now to not block commit jobs
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testConcurrentConsumerThreads() throws Exception {
         // test concurrent consumer threads on same consumerId
         final String topicName = "persistent://prop/ns-abc/topic3";
@@ -373,7 +373,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         executor.shutdown();
     }
 
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     // TODO: enable this after java client supports graceful close
     public void testGracefulClose() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic4";
@@ -440,7 +440,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         executor.shutdown();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSimpleCloseTopic() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic5";
         final String subName = "sub5";
@@ -472,7 +472,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         assertFalse(pulsar.getBrokerService().getTopicReference(topicName).isPresent());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSingleClientMultipleSubscriptions() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic6";
         final String subName = "sub6";
@@ -491,7 +491,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMultipleClientsMultipleSubscriptions() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic7";
         final String subName = "sub7";
@@ -515,7 +515,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTopicDeleteWithDisconnectedSubscription() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic8";
         final String subName = "sub1";
@@ -547,7 +547,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         return sub.getDispatcher().getConsumers().get(0).getAvailablePermits();
     }
 
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testUnloadNamespace() throws Exception {
         String topic = "persistent://prop/ns-abc/topic-9";
         TopicName topicName = TopicName.get(topic);
@@ -576,7 +576,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
                 .containsKey(topicName.getPersistenceNamingEncoding()));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGC() throws Exception {
         // 1. Simple successful GC
         String topicName = "persistent://prop/ns-abc/topic-10";
@@ -627,7 +627,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         return result != null && !result.schema.isDeleted();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGCWillDeleteSchema() throws Exception {
         // 1. Simple successful GC
         String topicName = "persistent://prop/ns-abc/topic-1";
@@ -686,7 +686,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
      * A topic that has retention policy set to non-0, should not be GCed until it has been inactive for at least the
      * retention time.
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testGcAndRetentionPolicy() throws Exception {
 
         // Retain data for at-least 10min
@@ -730,7 +730,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
      * A topic that has retention policy set to -1, should not be GCed until it has been inactive for at least the
      * retention time and the data should never be deleted
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testInfiniteRetentionPolicy() throws Exception {
         // Retain data forever
         admin.namespaces().setRetention("prop/ns-abc", new RetentionPolicies(-1, -1));
@@ -773,7 +773,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
      * Set retention policy in default configuration.
      * It should be effective.
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testServiceConfigurationRetentionPolicy() throws Exception {
         // set retention policy in service configuration
         pulsar.getConfiguration().setDefaultRetentionSizeInMB(-1);
@@ -816,7 +816,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         assertFalse(pulsar.getBrokerService().getTopicReference(topicName).isPresent());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMessageExpiry() throws Exception {
         int messageTTLSecs = 1;
         String namespaceName = "prop/expiry-check";
@@ -864,7 +864,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         admin.namespaces().deleteNamespace(namespaceName);
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testMessageExpiryWithFewExpiredBacklog() throws Exception {
         int messageTTLSecs = 10;
         String namespaceName = "prop/expiry-check-1";
@@ -908,7 +908,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         assertEquals(subRef.getNumberOfEntriesInBacklog(), 0);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSubscriptionTypeTransitions() throws Exception {
         final String topicName = "persistent://prop/ns-abc/shared-topic2";
         final String subName = "sub2";
@@ -988,7 +988,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         admin.topics().delete(topicName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReceiveWithTimeout() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic-receive-timeout";
         final String subName = "sub";
@@ -1021,7 +1021,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         assertEquals(consumer.getAvailablePermits(), 1);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProducerReturnedMessageId() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic-xyz";
 
@@ -1070,7 +1070,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProducerQueueFullBlocking() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic-xyzx";
         final int messages = 10;
@@ -1118,7 +1118,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         setup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProducerQueueFullNonBlocking() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic-xyzx";
         final int messages = 10;
@@ -1169,7 +1169,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         setup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDeleteTopics() throws Exception {
         BrokerService brokerService = pulsar.getBrokerService();
 
@@ -1217,7 +1217,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         return new Object[][] { { CompressionType.NONE }, { CompressionType.LZ4 }, { CompressionType.ZLIB }, };
     }
 
-    @Test(dataProvider = "codec")
+    @Test(timeOut = 10000, dataProvider = "codec")
     public void testCompression(CompressionType compressionType) throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic0" + compressionType;
 
@@ -1251,7 +1251,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         consumer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokerTopicStats() throws Exception {
 
         BrokerService brokerService = this.pulsar.getBrokerService();
@@ -1290,7 +1290,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         assertTrue(msgInRate > 0);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPayloadCorruptionDetection() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic1";
 
@@ -1346,7 +1346,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
      * 1. produce messages 2. consume messages and ack all except 1 msg 3. Verification: should replay only 1 unacked
      * message
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMessageRedelivery() throws Exception {
         final String topicName = "persistent://prop/ns-abc/topic2";
         final String subName = "sub2";
@@ -1410,7 +1410,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMessageReplay() throws Exception {
 
         final String topicName = "persistent://prop/ns-abc/topic2";
@@ -1484,7 +1484,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCreateProducerWithSameName() throws Exception {
         String topic = "persistent://prop/ns-abc/testCreateProducerWithSameName";
 
@@ -1510,7 +1510,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         p2.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetOrCreateTopic() throws Exception {
         String topicName = "persistent://prop/ns-abc/testGetOrCreateTopic";
 
@@ -1522,7 +1522,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         assertTrue(t.isPresent());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetTopicIfExists() throws Exception {
         String topicName = "persistent://prop/ns-abc/testGetTopicIfExists";
         admin.lookups().lookupTopic(topicName);
@@ -1533,7 +1533,7 @@ public class PersistentTopicE2ETest extends BrokerTestBase {
         assertFalse(t.isPresent());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testWithEventTime() throws Exception {
         final String topicName = "prop/ns-abc/topic-event-time";
         final String subName = "sub";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicTest.java
index 3000c27..ab42201 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/PersistentTopicTest.java
@@ -139,7 +139,7 @@ public class PersistentTopicTest {
     final String successSubName3 = "successSub3";
     private static final Logger log = LoggerFactory.getLogger(PersistentTopicTest.class);
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void setup() throws Exception {
         ServiceConfiguration svcConfig = spy(new ServiceConfiguration());
         pulsar = spy(new PulsarService(svcConfig));
@@ -187,7 +187,7 @@ public class PersistentTopicTest {
         setupMLAsyncCallbackMocks();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     public void teardown() throws Exception {
         brokerService.getTopics().clear();
         brokerService.close(); //to clear pulsarStats
@@ -199,7 +199,7 @@ public class PersistentTopicTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCreateTopic() throws Exception {
         final ManagedLedger ledgerMock = mock(ManagedLedger.class);
         doReturn(new ArrayList<Object>()).when(ledgerMock).getCursors();
@@ -229,7 +229,7 @@ public class PersistentTopicTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCreateTopicMLFailure() throws Exception {
         final String jinxedTopicName = "persistent://prop/use/ns-abc/topic3";
         doAnswer(new Answer<Object>() {
@@ -258,7 +258,7 @@ public class PersistentTopicTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPublishMessage() throws Exception {
 
         PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
@@ -278,7 +278,7 @@ public class PersistentTopicTest {
         assertTrue(latch.await(1, TimeUnit.SECONDS));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDispatcherMultiConsumerReadFailed() throws Exception {
         PersistentTopic topic = spy(new PersistentTopic(successTopicName, ledgerMock, brokerService));
         ManagedCursor cursor = mock(ManagedCursor.class);
@@ -288,7 +288,7 @@ public class PersistentTopicTest {
         verify(topic, atLeast(1)).getBrokerService();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDispatcherSingleConsumerReadFailed() throws Exception {
         PersistentTopic topic = spy(new PersistentTopic(successTopicName, ledgerMock, brokerService));
         ManagedCursor cursor = mock(ManagedCursor.class);
@@ -300,7 +300,7 @@ public class PersistentTopicTest {
         verify(topic, atLeast(1)).getBrokerService();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPublishMessageMLFailure() throws Exception {
         final String successTopicName = "persistent://prop/use/ns-abc/successTopic";
 
@@ -338,7 +338,7 @@ public class PersistentTopicTest {
         assertTrue(latch.await(1, TimeUnit.SECONDS));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAddRemoveProducer() throws Exception {
         PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
 
@@ -400,7 +400,7 @@ public class PersistentTopicTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMaxProducersForBroker() throws Exception {
         // set max clients
         ServiceConfiguration svcConfig = spy(new ServiceConfiguration());
@@ -409,7 +409,7 @@ public class PersistentTopicTest {
         testMaxProducers();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMaxProducersForNamespace() throws Exception {
         ServiceConfiguration svcConfig = spy(new ServiceConfiguration());
         doReturn(svcConfig).when(pulsar).getConfiguration();
@@ -422,7 +422,7 @@ public class PersistentTopicTest {
         testMaxProducers();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSubscribeFail() throws Exception {
         PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
 
@@ -442,7 +442,7 @@ public class PersistentTopicTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSubscribeUnsubscribe() throws Exception {
         PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
 
@@ -475,7 +475,7 @@ public class PersistentTopicTest {
         assertNull(topic.getSubscription(successSubName));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAddRemoveConsumer() throws Exception {
         PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
         PersistentSubscription sub = new PersistentSubscription(topic, "sub-1", cursorMock, false);
@@ -570,7 +570,7 @@ public class PersistentTopicTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMaxConsumersSharedForBroker() throws Exception {
         // set max clients
         ServiceConfiguration svcConfig = spy(new ServiceConfiguration());
@@ -581,7 +581,7 @@ public class PersistentTopicTest {
         testMaxConsumersShared();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMaxConsumersSharedForNamespace() throws Exception {
         ServiceConfiguration svcConfig = spy(new ServiceConfiguration());
         doReturn(svcConfig).when(pulsar).getConfiguration();
@@ -661,7 +661,7 @@ public class PersistentTopicTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMaxConsumersFailoverForBroker() throws Exception {
         // set max clients
         ServiceConfiguration svcConfig = spy(new ServiceConfiguration());
@@ -672,7 +672,7 @@ public class PersistentTopicTest {
         testMaxConsumersFailover();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMaxConsumersFailoverForNamespace() throws Exception {
         ServiceConfiguration svcConfig = spy(new ServiceConfiguration());
         doReturn(svcConfig).when(pulsar).getConfiguration();
@@ -688,7 +688,7 @@ public class PersistentTopicTest {
         testMaxConsumersFailover();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUbsubscribeRaceConditions() throws Exception {
         PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
         PersistentSubscription sub = new PersistentSubscription(topic, "sub-1", cursorMock, false);
@@ -721,7 +721,7 @@ public class PersistentTopicTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDeleteTopic() throws Exception {
         // create topic
         PersistentTopic topic = (PersistentTopic) brokerService.getOrCreateTopic(successTopicName).get();
@@ -753,7 +753,7 @@ public class PersistentTopicTest {
         topic.unsubscribe(successSubName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDeleteAndUnsubscribeTopic() throws Exception {
         // create topic
         final PersistentTopic topic = (PersistentTopic) brokerService.getOrCreateTopic(successTopicName).get();
@@ -808,7 +808,7 @@ public class PersistentTopicTest {
         assertFalse(gotException.get());
     }
 
-    // @Test
+    // @Test(timeOut = 10000)
     public void testConcurrentTopicAndSubscriptionDelete() throws Exception {
         // create topic
         final PersistentTopic topic = (PersistentTopic) brokerService.getOrCreateTopic(successTopicName).get();
@@ -868,7 +868,7 @@ public class PersistentTopicTest {
         assertFalse(gotException.get());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDeleteTopicRaceConditions() throws Exception {
         PersistentTopic topic = (PersistentTopic) brokerService.getOrCreateTopic(successTopicName).get();
 
@@ -1023,7 +1023,7 @@ public class PersistentTopicTest {
             }).when(cursorMock).asyncMarkDelete(any(), any(), any(MarkDeleteCallback.class), any());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testFailoverSubscription() throws Exception {
         PersistentTopic topic1 = new PersistentTopic(successTopicName, ledgerMock, brokerService);
 
@@ -1177,7 +1177,7 @@ public class PersistentTopicTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testAtomicReplicationRemoval() throws Exception {
         final String globalTopicName = "persistent://prop/global/ns-abc/successTopic";
         String localCluster = "local";
@@ -1223,7 +1223,7 @@ public class PersistentTopicTest {
     }
 
     @SuppressWarnings("unchecked")
-    @Test
+    @Test(timeOut = 10000)
     public void testClosingReplicationProducerTwice() throws Exception {
         final String globalTopicName = "persistent://prop/global/ns/testClosingReplicationProducerTwice";
         String localCluster = "local";
@@ -1261,7 +1261,7 @@ public class PersistentTopicTest {
         verify(clientImpl, Mockito.times(2)).createProducerAsync(any(), any(), any());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCompactorSubscription() throws Exception {
         PersistentTopic topic = new PersistentTopic(successTopicName, ledgerMock, brokerService);
         CompactedTopic compactedTopic = mock(CompactedTopic.class);
@@ -1276,7 +1276,7 @@ public class PersistentTopicTest {
     }
 
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCompactorSubscriptionUpdatedOnInit() throws Exception {
         long ledgerId = 0xc0bfefeL;
         Map<String, Long> properties = ImmutableMap.of(Compactor.COMPACTED_TOPIC_LEDGER_PROPERTY, ledgerId);
@@ -1291,7 +1291,7 @@ public class PersistentTopicTest {
         verify(compactedTopic, Mockito.times(1)).newCompactedLedger(position, ledgerId);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCompactionTriggeredAfterThresholdFirstInvocation() throws Exception {
         CompletableFuture<Long> compactPromise = new CompletableFuture<>();
         Compactor compactor = pulsar.getCompactor();
@@ -1319,7 +1319,7 @@ public class PersistentTopicTest {
         verify(compactor, times(1)).compact(anyString());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCompactionTriggeredAfterThresholdSecondInvocation() throws Exception {
         CompletableFuture<Long> compactPromise = new CompletableFuture<>();
         Compactor compactor = pulsar.getCompactor();
@@ -1351,7 +1351,7 @@ public class PersistentTopicTest {
         verify(compactor, times(1)).compact(anyString());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCompactionDisabledWithZeroThreshold() throws Exception {
         CompletableFuture<Long> compactPromise = new CompletableFuture<>();
         Compactor compactor = pulsar.getCompactor();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/RackAwareTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/RackAwareTest.java
index daa6fe5..0c877d9 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/RackAwareTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/RackAwareTest.java
@@ -50,7 +50,7 @@ public class RackAwareTest extends BrokerBkEnsemblesTests {
         super(0);
     }
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     protected void setup() throws Exception {
         super.setup();
 
@@ -81,7 +81,7 @@ public class RackAwareTest extends BrokerBkEnsemblesTests {
 
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     protected void shutdown() throws Exception {
         super.shutdown();
 
@@ -92,7 +92,7 @@ public class RackAwareTest extends BrokerBkEnsemblesTests {
         bookies.clear();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPlacement() throws Exception {
         for (int i = 0; i < NUM_BOOKIES; i++) {
             String bookie = bookies.get(i).getLocalAddress().toString();
@@ -120,17 +120,17 @@ public class RackAwareTest extends BrokerBkEnsemblesTests {
         }
     }
 
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testCrashBrokerWithoutCursorLedgerLeak() throws Exception {
         // Ignore test
     }
 
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testSkipCorruptDataLedger() throws Exception {
         // Ignore test
     }
 
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testTopicWithWildCardChar() throws Exception {
         // Ignore test
     }
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorGlobalNSTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorGlobalNSTest.java
index da48dd9..f2ad61b 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorGlobalNSTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorGlobalNSTest.java
@@ -39,19 +39,19 @@ public class ReplicatorGlobalNSTest extends ReplicatorTestBase {
 
     protected String methodName;
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void beforeMethod(Method m) {
         methodName = m.getName();
     }
 
     @Override
-    @BeforeClass(timeOut = 300000)
+    @BeforeClass( timeOut = 300000)
     void setup() throws Exception {
         super.setup();
     }
 
     @Override
-    @AfterClass(timeOut = 300000)
+    @AfterClass( timeOut = 300000)
     void shutdown() throws Exception {
         super.shutdown();
     }
@@ -62,7 +62,7 @@ public class ReplicatorGlobalNSTest extends ReplicatorTestBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testRemoveLocalClusterOnGlobalNamespace() throws Exception {
         log.info("--- Starting ReplicatorTest::testRemoveLocalClusterOnGlobalNamespace ---");
 
@@ -98,7 +98,7 @@ public class ReplicatorGlobalNSTest extends ReplicatorTestBase {
         client2.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testForcefullyTopicDeletion() throws Exception {
         log.info("--- Starting ReplicatorTest::testForcefullyTopicDeletion ---");
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorRateLimiterTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorRateLimiterTest.java
index dba37ac..68d0687 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorRateLimiterTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorRateLimiterTest.java
@@ -48,7 +48,7 @@ public class ReplicatorRateLimiterTest extends ReplicatorTestBase {
 
     protected String methodName;
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     public void beforeMethod(Method m) throws Exception {
         methodName = m.getName();
     }
@@ -83,7 +83,7 @@ public class ReplicatorRateLimiterTest extends ReplicatorTestBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testReplicatorRateLimiterDynamicallyChange() throws Exception {
         log.info("--- Starting ReplicatorTest::{} --- ", methodName);
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java
index f68214a..21b0de7 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTest.java
@@ -89,7 +89,7 @@ public class ReplicatorTest extends ReplicatorTestBase {
 
     protected String methodName;
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     public void beforeMethod(Method m) throws Exception {
         methodName = m.getName();
     }
@@ -111,7 +111,7 @@ public class ReplicatorTest extends ReplicatorTestBase {
         return new Object[][] { { Boolean.TRUE }, { Boolean.FALSE } };
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testConfigChange() throws Exception {
         log.info("--- Starting ReplicatorTest::testConfigChange ---");
         // This test is to verify that the config change on global namespace is successfully applied in broker during
@@ -249,7 +249,7 @@ public class ReplicatorTest extends ReplicatorTestBase {
         return new Object[][] { { "pulsar/ns" }, { "pulsar/global/ns" } };
     }
 
-    @Test(dataProvider = "namespace")
+    @Test(timeOut = 10000, dataProvider = "namespace")
     public void testReplication(String namespace) throws Exception {
         log.info("--- Starting ReplicatorTest::testReplication ---");
 
@@ -327,7 +327,7 @@ public class ReplicatorTest extends ReplicatorTestBase {
         consumer3.receive(1);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReplicationOverrides() throws Exception {
         log.info("--- Starting ReplicatorTest::testReplicationOverrides ---");
 
@@ -388,7 +388,7 @@ public class ReplicatorTest extends ReplicatorTestBase {
         }
     }
 
-    @Test()
+    @Test(timeOut = 10000)
     public void testFailures() throws Exception {
 
         log.info("--- Starting ReplicatorTest::testFailures ---");
@@ -434,7 +434,7 @@ public class ReplicatorTest extends ReplicatorTestBase {
     public void testReplicatorClearBacklog() throws Exception {
 
         // This test is to verify that reset cursor fails on global topic
-        SortedSet<String> testDests = new TreeSet<String>();
+        SortedSet<String> testDests = new TreeSet<>();
 
         final TopicName dest = TopicName.get("persistent://pulsar/ns/clearBacklogTopic");
         testDests.add(dest.toString());
@@ -459,7 +459,7 @@ public class ReplicatorTest extends ReplicatorTestBase {
         assertEquals(status.replicationBacklog, 0);
     }
 
-    @Test(enabled = true, timeOut = 30000)
+    @Test(timeOut = 30000)
     public void testResetCursorNotFail() throws Exception {
 
         log.info("--- Starting ReplicatorTest::testResetCursorNotFail ---");
@@ -484,7 +484,7 @@ public class ReplicatorTest extends ReplicatorTestBase {
         admin1.topics().resetCursor(dest.toString(), "sub-id", System.currentTimeMillis());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReplicationForBatchMessages() throws Exception {
         log.info("--- Starting ReplicatorTest::testReplicationForBatchMessages ---");
 
@@ -611,7 +611,7 @@ public class ReplicatorTest extends ReplicatorTestBase {
      * @throws Exception
      */
 
-    @Test(timeOut = 60000, enabled = true, priority = -1)
+    @Test(timeOut = 60000, priority = -1)
     public void testResumptionAfterBacklogRelaxed() throws Exception {
         List<RetentionPolicy> policies = Lists.newArrayList();
         policies.add(RetentionPolicy.producer_exception);
@@ -761,7 +761,7 @@ public class ReplicatorTest extends ReplicatorTestBase {
      * @param isPartitionedTopic
      * @throws Exception
      */
-    @Test(dataProvider = "partitionedTopic")
+    @Test(timeOut = 10000, dataProvider = "partitionedTopic")
     public void testReplicatorOnPartitionedTopic(boolean isPartitionedTopic) throws Exception {
 
         log.info("--- Starting ReplicatorTest::{} --- ", methodName);
@@ -814,7 +814,7 @@ public class ReplicatorTest extends ReplicatorTestBase {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReplicatedCluster() throws Exception {
 
         log.info("--- Starting ReplicatorTest::testReplicatedCluster ---");
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTlsTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTlsTest.java
index 3ad22e9..d5b25a8 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTlsTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ReplicatorTlsTest.java
@@ -33,7 +33,7 @@ import org.testng.collections.Lists;
 public class ReplicatorTlsTest extends ReplicatorTestBase {
 
     @Override
-    @BeforeClass(timeOut = 300000)
+    @BeforeClass( timeOut = 300000)
     void setup() throws Exception {
         config1.setBrokerClientTlsEnabled(true);
         config2.setBrokerClientTlsEnabled(true);
@@ -42,12 +42,12 @@ public class ReplicatorTlsTest extends ReplicatorTestBase {
     }
 
     @Override
-    @AfterClass(timeOut = 300000)
+    @AfterClass( timeOut = 300000)
     void shutdown() throws Exception {
         super.shutdown();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReplicationClient() throws Exception {
         log.info("--- Starting ReplicatorTlsTest::testReplicationClient ---");
         for (BrokerService ns : Lists.newArrayList(ns1, ns2, ns3)) {
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ResendRequestTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ResendRequestTest.java
index e6bdd71..1c567d4 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ResendRequestTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ResendRequestTest.java
@@ -45,13 +45,13 @@ public class ResendRequestTest extends BrokerTestBase {
     private static final long testTimeout = 60000; // 1 min
     private static final Logger log = LoggerFactory.getLogger(ResendRequestTest.class);
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     public void setup() throws Exception {
         super.internalSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ServerCnxTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ServerCnxTest.java
index d1fa866..803e675 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ServerCnxTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/ServerCnxTest.java
@@ -114,7 +114,7 @@ import org.testng.annotations.Test;
 
 /**
  */
-@Test
+@Test(timeOut = 10000)
 @SuppressWarnings("unchecked")
 public class ServerCnxTest {
     protected EmbeddedChannel channel;
@@ -140,7 +140,7 @@ public class ServerCnxTest {
     private ManagedLedger ledgerMock = mock(ManagedLedger.class);
     private ManagedCursor cursorMock = mock(ManagedCursor.class);
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     public void setup() throws Exception {
         svcConfig = spy(new ServiceConfiguration());
         pulsar = spy(new PulsarService(svcConfig));
@@ -193,7 +193,7 @@ public class ServerCnxTest {
         return (int) TimeUnit.SECONDS.convert(time, unit);
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     public void teardown() throws Exception {
         serverCnx.close();
         channel.close();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SubscriptionSeekTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SubscriptionSeekTest.java
index 99be7f4..60c512a 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SubscriptionSeekTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/SubscriptionSeekTest.java
@@ -38,21 +38,21 @@ import org.testng.annotations.Test;
 
 /**
  */
-@Test
+@Test(timeOut = 10000)
 public class SubscriptionSeekTest extends BrokerTestBase {
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSeek() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/testSeek";
 
@@ -90,7 +90,7 @@ public class SubscriptionSeekTest extends BrokerTestBase {
         assertEquals(sub.getNumberOfEntriesInBacklog(), 5);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSeekOnPartitionedTopic() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/testSeekPartitions";
 
@@ -106,7 +106,7 @@ public class SubscriptionSeekTest extends BrokerTestBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSeekTime() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/testSeekTime";
         String resetTimeStr = "100s";
@@ -142,7 +142,7 @@ public class SubscriptionSeekTest extends BrokerTestBase {
         assertEquals(sub.getNumberOfEntriesInBacklog(), 10);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSeekTimeOnPartitionedTopic() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/testSeekTimePartitions";
         long timestamp = 1550479732;
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/TopicTerminationTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/TopicTerminationTest.java
index e096577..64b6c62 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/TopicTerminationTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/TopicTerminationTest.java
@@ -48,15 +48,15 @@ import org.testng.annotations.AfterMethod;
 import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-@Test
+@Test(timeOut = 10000)
 public class TopicTerminationTest extends BrokerTestBase {
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -64,7 +64,7 @@ public class TopicTerminationTest extends BrokerTestBase {
 
     private final String topicName = "persistent://prop/ns-abc/topic0";
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSimpleTermination() throws Exception {
         Producer<byte[]> producer = pulsarClient.newProducer().topic(topicName)
             .enableBatching(false)
@@ -86,7 +86,7 @@ public class TopicTerminationTest extends BrokerTestBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCreateProducerOnTerminatedTopic() throws Exception {
         Producer<byte[]> producer = pulsarClient.newProducer().topic(topicName)
             .enableBatching(false)
@@ -156,7 +156,7 @@ public class TopicTerminationTest extends BrokerTestBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDoubleTerminate() throws Exception {
         Producer<byte[]> producer = pulsarClient.newProducer().topic(topicName)
             .enableBatching(false)
@@ -175,7 +175,7 @@ public class TopicTerminationTest extends BrokerTestBase {
         assertEquals(lastMessageId, msgId3);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTerminatePartitionedTopic() throws Exception {
         admin.topics().createPartitionedTopic(topicName, 4);
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ChecksumTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ChecksumTest.java
index d15d9d0..4153376 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ChecksumTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ChecksumTest.java
@@ -41,21 +41,21 @@ import io.netty.buffer.ByteBuf;
 
 /**
  */
-@Test
+@Test(timeOut = 10000)
 public class ChecksumTest extends BrokerTestBase {
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void verifyChecksumStoredInManagedLedger() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/topic0";
 
@@ -82,7 +82,7 @@ public class ChecksumTest extends BrokerTestBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void verifyChecksumSentToConsumer() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/topic-1";
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/DelayedDeliveryTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/DelayedDeliveryTest.java
index 6dab836..7980ca6 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/DelayedDeliveryTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/DelayedDeliveryTest.java
@@ -41,19 +41,19 @@ import org.testng.annotations.Test;
 public class DelayedDeliveryTest extends ProducerConsumerBase {
 
     @Override
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     public void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
     @Override
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     public void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDelayedDelivery()
             throws Exception {
         String topic = "testNegativeAcks-" + System.nanoTime();
@@ -108,7 +108,7 @@ public class DelayedDeliveryTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testInterleavedMessages()
             throws Exception {
         String topic = "testInterleavedMessages-" + System.nanoTime();
@@ -160,7 +160,7 @@ public class DelayedDeliveryTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testEverythingFilteredInMultipleReads()
             throws Exception {
         String topic = "testEverythingFilteredInMultipleReads-" + System.nanoTime();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/PersistentSubscriptionTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/PersistentSubscriptionTest.java
index 94a558a..b2ddd6c 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/PersistentSubscriptionTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/PersistentSubscriptionTest.java
@@ -92,7 +92,7 @@ public class PersistentSubscriptionTest {
 
     private static final Logger log = LoggerFactory.getLogger(PersistentTopicTest.class);
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void setup() throws Exception {
         ServiceConfiguration svcConfig = spy(new ServiceConfiguration());
         pulsarMock = spy(new PulsarService(svcConfig));
@@ -143,7 +143,7 @@ public class PersistentSubscriptionTest {
         persistentSubscription = new PersistentSubscription(topic, subName, cursorMock, false);
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     public void teardown() throws Exception {
         brokerMock.close(); //to clear pulsarStats
         try {
@@ -154,7 +154,7 @@ public class PersistentSubscriptionTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCanAcknowledgeAndCommitForTransaction() throws TransactionConflictException {
         List<Position> expectedSinglePositions = new ArrayList<>();
         expectedSinglePositions.add(new PositionImpl(1, 1));
@@ -197,7 +197,7 @@ public class PersistentSubscriptionTest {
         verify(cursorMock, times(1)).asyncMarkDelete(any(), any(Map.class), any(), any());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCanAcknowledgeAndAbortForTransaction() throws TransactionConflictException, BrokerServiceException {
         List<Position> positions = new ArrayList<>();
         positions.add(new PositionImpl(2, 1));
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionConfigTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionConfigTest.java
index 8ec937d..8c09b2b 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionConfigTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionConfigTest.java
@@ -33,19 +33,19 @@ import org.testng.annotations.Test;
 
 public class ReplicatedSubscriptionConfigTest extends ProducerConsumerBase {
     @Override
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     public void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
     @Override
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     public void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void createReplicatedSubscription() throws Exception {
         String topic = "createReplicatedSubscription-" + System.nanoTime();
 
@@ -66,7 +66,7 @@ public class ReplicatedSubscriptionConfigTest extends ProducerConsumerBase {
         assertTrue(stats.subscriptions.get("sub1").isReplicated);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void upgradeToReplicatedSubscription() throws Exception {
         String topic = "upgradeToReplicatedSubscription-" + System.nanoTime();
 
@@ -91,7 +91,7 @@ public class ReplicatedSubscriptionConfigTest extends ProducerConsumerBase {
         consumer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void upgradeToReplicatedSubscriptionAfterRestart() throws Exception {
         String topic = "upgradeToReplicatedSubscriptionAfterRestart-" + System.nanoTime();
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionSnapshotCacheTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionSnapshotCacheTest.java
index a103945..80bc747 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionSnapshotCacheTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionSnapshotCacheTest.java
@@ -28,7 +28,7 @@ import org.apache.pulsar.common.api.proto.PulsarMarkers.ReplicatedSubscriptionsS
 import org.testng.annotations.Test;
 
 public class ReplicatedSubscriptionSnapshotCacheTest {
-    @Test
+    @Test(timeOut = 10000)
     public void testSnashotCache() {
         ReplicatedSubscriptionSnapshotCache cache = new ReplicatedSubscriptionSnapshotCache("my-subscription", 10);
 
@@ -70,7 +70,7 @@ public class ReplicatedSubscriptionSnapshotCacheTest {
         assertNull(cache.advancedMarkDeletePosition(new PositionImpl(5, 5)));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSnashotCachePruning() {
         ReplicatedSubscriptionSnapshotCache cache = new ReplicatedSubscriptionSnapshotCache("my-subscription", 3);
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionsSnapshotBuilderTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionsSnapshotBuilderTest.java
index 0d5e351..22f1aa8 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionsSnapshotBuilderTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/persistent/ReplicatedSubscriptionsSnapshotBuilderTest.java
@@ -54,7 +54,7 @@ public class ReplicatedSubscriptionsSnapshotBuilderTest {
     private ReplicatedSubscriptionsController controller;
     private List<ByteBuf> markers;
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void setup() {
         clock = mock(Clock.class);
         when(clock.millis()).thenAnswer(invocation -> currentTime);
@@ -75,7 +75,7 @@ public class ReplicatedSubscriptionsSnapshotBuilderTest {
                 .writeMarker(any(ByteBuf.class));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBuildSnapshotWith2Clusters() throws Exception {
         List<String> remoteClusters = Arrays.asList("b");
 
@@ -116,7 +116,7 @@ public class ReplicatedSubscriptionsSnapshotBuilderTest {
         assertEquals(snapshot.getLocalMessageId().getEntryId(), 1);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBuildSnapshotWith3Clusters() throws Exception {
         List<String> remoteClusters = Arrays.asList("b", "c");
 
@@ -206,7 +206,7 @@ public class ReplicatedSubscriptionsSnapshotBuilderTest {
         assertEquals(snapshot.getLocalMessageId().getEntryId(), 4);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBuildTimeout() throws Exception {
         List<String> remoteClusters = Arrays.asList("b");
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/BaseAvroSchemaCompatibilityTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/BaseAvroSchemaCompatibilityTest.java
index bea4e91..e61b553 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/BaseAvroSchemaCompatibilityTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/BaseAvroSchemaCompatibilityTest.java
@@ -83,7 +83,7 @@ public abstract class BaseAvroSchemaCompatibilityTest {
     /**
      * make sure new schema is backwards compatible with latest
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testBackwardCompatibility() {
 
         SchemaCompatibilityCheck schemaCompatibilityCheck = getSchemaCheck();
@@ -120,7 +120,7 @@ public abstract class BaseAvroSchemaCompatibilityTest {
     /**
      * Check to make sure the last schema version is forward-compatible with new schemas
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testForwardCompatibility() {
 
         SchemaCompatibilityCheck schemaCompatibilityCheck = getSchemaCheck();
@@ -151,7 +151,7 @@ public abstract class BaseAvroSchemaCompatibilityTest {
     /**
      * Make sure the new schema is forward- and backward-compatible from the latest to newest and from the newest to latest.
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testFullCompatibility() {
         SchemaCompatibilityCheck schemaCompatibilityCheck = getSchemaCheck();
         Assert.assertTrue(schemaCompatibilityCheck.isCompatible(schemaData1, schemaData2,
@@ -166,7 +166,7 @@ public abstract class BaseAvroSchemaCompatibilityTest {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBackwardTransitive() {
         SchemaCompatibilityCheck schemaCompatibilityCheck = getSchemaCheck();
         Assert.assertTrue(schemaCompatibilityCheck.isCompatible(Arrays.asList(schemaData1, schemaData2), schemaData5,
@@ -183,7 +183,7 @@ public abstract class BaseAvroSchemaCompatibilityTest {
                 schemaData8, SchemaCompatibilityStrategy.BACKWARD_TRANSITIVE));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testForwardTransitive() {
         SchemaCompatibilityCheck schemaCompatibilityCheck = getSchemaCheck();
         Assert.assertTrue(schemaCompatibilityCheck.isCompatible(Arrays.asList(schemaData1, schemaData2), schemaData3,
@@ -196,7 +196,7 @@ public abstract class BaseAvroSchemaCompatibilityTest {
                 SchemaCompatibilityStrategy.FORWARD_TRANSITIVE));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testFullTransitive() {
         SchemaCompatibilityCheck schemaCompatibilityCheck = getSchemaCheck();
         Assert.assertTrue(schemaCompatibilityCheck.isCompatible(Arrays.asList(schemaData1, schemaData2), schemaData3,
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorageTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorageTest.java
index e22462e..ed4f40f 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorageTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/BookkeeperSchemaStorageTest.java
@@ -31,7 +31,7 @@ import static org.testng.Assert.assertEquals;
 
 public class BookkeeperSchemaStorageTest {
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBkException() {
         Exception ex = bkException("test", BKException.Code.ReadException, 1, -1);
         assertEquals("Error while reading ledger -  ledger=1 - operation=test", ex.getMessage());
@@ -46,7 +46,7 @@ public class BookkeeperSchemaStorageTest {
                 ex.getMessage());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testVersionFromBytes() {
         long version = System.currentTimeMillis();
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/ClientGetSchemaTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/ClientGetSchemaTest.java
index 9fcd231..0785bba 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/ClientGetSchemaTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/ClientGetSchemaTest.java
@@ -54,7 +54,7 @@ public class ClientGetSchemaTest extends ProducerConsumerBase {
         public int age;
     }
 
-    @BeforeClass
+    @BeforeClass(timeOut = 60000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
@@ -72,7 +72,7 @@ public class ClientGetSchemaTest extends ProducerConsumerBase {
 
     }
 
-    @AfterClass
+    @AfterClass(timeOut = 60000)
     @Override
     protected void cleanup() throws Exception {
         producers.forEach(t -> {
@@ -90,7 +90,7 @@ public class ClientGetSchemaTest extends ProducerConsumerBase {
                 "http://" + pulsar.getAdvertisedAddress() + ":" + BROKER_WEBSERVICE_PORT };
     }
 
-    @Test(dataProvider = "serviceUrl")
+    @Test(timeOut = 10000, dataProvider = "serviceUrl")
     public void testGetSchema(String serviceUrl) throws Exception {
         @Cleanup
         PulsarClientImpl client = (PulsarClientImpl) PulsarClient.builder().serviceUrl(serviceUrl).build();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/JsonSchemaCompatibilityCheckTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/JsonSchemaCompatibilityCheckTest.java
index f234b18..d09ec99 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/JsonSchemaCompatibilityCheckTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/JsonSchemaCompatibilityCheckTest.java
@@ -48,7 +48,7 @@ public class JsonSchemaCompatibilityCheckTest extends BaseAvroSchemaCompatibilit
         return new JsonSchemaCompatibilityCheck();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testJsonSchemaBackwardsCompatibility() throws JsonProcessingException {
 
         SchemaData from = SchemaData.builder().data(OldJSONSchema.of(Foo.class).getSchemaInfo().getSchema()).build();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/KeyValueSchemaCompatibilityCheckTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/KeyValueSchemaCompatibilityCheckTest.java
index 0755781..3cd5324 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/KeyValueSchemaCompatibilityCheckTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/KeyValueSchemaCompatibilityCheckTest.java
@@ -56,14 +56,14 @@ public class KeyValueSchemaCompatibilityCheckTest {
         private boolean field1;
     }
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     protected void setup() {
         checkers.put(SchemaType.AVRO, new AvroSchemaCompatibilityCheck());
         checkers.put(SchemaType.JSON, new JsonSchemaCompatibilityCheck());
         checkers.put(SchemaType.KEY_VALUE, new KeyValueSchemaCompatibilityCheck(checkers));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyValueAvroCompatibilityFull() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -77,7 +77,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FULL));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyValueAvroInCompatibilityFull() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -91,7 +91,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertFalse(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FULL));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyValueAvroCompatibilityBackward() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -105,7 +105,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.BACKWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyValueAvroInCompatibilityBackward() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -119,7 +119,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertFalse(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.BACKWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyValueAvroCompatibilityForward() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -133,7 +133,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FORWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyValueAvroInCompatibilityForward() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -147,7 +147,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertFalse(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FORWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyValueJsonCompatibilityFull() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         JSONSchema<Bar> barSchema = JSONSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -161,7 +161,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FULL));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyValueJsonInCompatibilityFull() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         JSONSchema<Bar> barSchema = JSONSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -175,7 +175,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertFalse(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FULL));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyValueJsonCompatibilityBackward() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         JSONSchema<Bar> barSchema = JSONSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -189,7 +189,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.BACKWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyValueJsonInCompatibilityBackWard() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         JSONSchema<Bar> barSchema = JSONSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -203,7 +203,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertFalse(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.BACKWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyValueJsonCompatibilityForward() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         JSONSchema<Bar> barSchema = JSONSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -217,7 +217,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FORWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyValueJsonInCompatibilityForward() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         JSONSchema<Bar> barSchema = JSONSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -231,7 +231,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertFalse(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FORWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyAvroValueJsonCompatibilityFull() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         JSONSchema<Bar> barSchema = JSONSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -245,7 +245,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FULL));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyAvroValueJsonInCompatibilityFull() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         JSONSchema<Bar> barSchema = JSONSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -259,7 +259,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertFalse(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FULL));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyAvroValueJsonCompatibilityBackward() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         JSONSchema<Bar> barSchema = JSONSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -273,7 +273,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.BACKWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyAvroValueJsonInCompatibilityBackward() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         JSONSchema<Bar> barSchema = JSONSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -287,7 +287,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertFalse(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.BACKWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyAvroValueJsonCompatibilityForward() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         JSONSchema<Bar> barSchema = JSONSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -301,7 +301,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FORWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyAvroValueJsonInCompatibilityForward() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         JSONSchema<Bar> barSchema = JSONSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -315,7 +315,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertFalse(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FORWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyJsonValueAvroCompatibilityFull() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -329,7 +329,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FULL));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyJsonValueAvroInCompatibilityFull() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -343,7 +343,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertFalse(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FULL));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyJsonValueAvroCompatibilityBackward() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -357,7 +357,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.BACKWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyJsonValueAvroInCompatibilityBackward() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -372,7 +372,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
     }
 
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyJsonValueAvroCompatibilityForward() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -386,7 +386,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FORWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyJsonValueAvroInCompatibilityForward() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -400,7 +400,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertFalse(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FORWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyJsonValueAvroKeyTypeInCompatibility() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -417,7 +417,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertFalse(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FORWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckKeyJsonValueAvroValueTypeInCompatibility() {
         JSONSchema<Foo> fooSchema = JSONSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -434,7 +434,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertFalse(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FORWARD));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckPropertiesNullTypeCompatibility() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -451,7 +451,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FULL));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckSchemaTypeNullCompatibility() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -464,7 +464,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.FULL));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckSchemaTypeAlwaysCompatibility() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
@@ -476,7 +476,7 @@ public class KeyValueSchemaCompatibilityCheckTest {
         Assert.assertTrue(checkers.get(SchemaType.KEY_VALUE).isCompatible(fromSchemaData, toSchemaData, SchemaCompatibilityStrategy.ALWAYS_COMPATIBLE));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckSchemaTypeOtherCompatibility() {
         AvroSchema<Foo> fooSchema = AvroSchema.of(SchemaDefinition.<Foo>builder().withPojo(Foo.class).build());
         AvroSchema<Bar> barSchema = AvroSchema.of(SchemaDefinition.<Bar>builder().withPojo(Bar.class).build());
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/PartitionedTopicsSchemaTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/PartitionedTopicsSchemaTest.java
index 6e9b122..f7a784d 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/PartitionedTopicsSchemaTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/PartitionedTopicsSchemaTest.java
@@ -39,7 +39,7 @@ public class PartitionedTopicsSchemaTest extends BrokerBkEnsemblesTests {
     /**
      * Test that sequence id from a producer is correct when there are send errors
      */
-    @Test
+    @Test(timeOut = 10000)
     public void partitionedTopicWithSchema() throws Exception {
         admin.namespaces().createNamespace("prop/my-test", Collections.singleton("usc"));
 
@@ -95,12 +95,12 @@ public class PartitionedTopicsSchemaTest extends BrokerBkEnsemblesTests {
         client.close();
     }
 
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testCrashBrokerWithoutCursorLedgerLeak() throws Exception {
         // Ignore test
     }
 
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testSkipCorruptDataLedger() throws Exception {
         // Ignore test
     }
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/SchemaServiceTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/SchemaServiceTest.java
index 0c2a174..ce73e67 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/SchemaServiceTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/SchemaServiceTest.java
@@ -82,7 +82,7 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
 
     private SchemaRegistryServiceImpl schemaRegistryService;
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
@@ -94,14 +94,14 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
         schemaRegistryService = new SchemaRegistryServiceImpl(storage, checkMap, MockClock);
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
         schemaRegistryService.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void writeReadBackDeleteSchemaEntry() throws Exception {
         putSchema(schemaId1, schema1, version(0));
 
@@ -113,13 +113,13 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
         assertNull(schemaRegistryService.getSchema(schemaId1).get());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void findSchemaVersionTest() throws Exception {
         putSchema(schemaId1, schema1, version(0));
         assertEquals(0, schemaRegistryService.findSchemaVersion(schemaId1, schema1).get().longValue());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void deleteSchemaAndAddSchema() throws Exception {
         putSchema(schemaId1, schema1, version(0));
         SchemaData latest = getLatestSchema(schemaId1, version(0));
@@ -136,7 +136,7 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void getReturnsTheLastWrittenEntry() throws Exception {
         putSchema(schemaId1, schema1, version(0));
         putSchema(schemaId1, schema2, version(1));
@@ -146,7 +146,7 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void getByVersionReturnsTheCorrectEntry() throws Exception {
         putSchema(schemaId1, schema1, version(0));
         putSchema(schemaId1, schema2, version(1));
@@ -155,7 +155,7 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
         assertEquals(schema1, version0);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void getByVersionReturnsTheCorrectEntry2() throws Exception {
         putSchema(schemaId1, schema1, version(0));
         putSchema(schemaId1, schema2, version(1));
@@ -164,7 +164,7 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
         assertEquals(schema2, version1);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void getByVersionReturnsTheCorrectEntry3() throws Exception {
         putSchema(schemaId1, schema1, version(0));
 
@@ -172,7 +172,7 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
         assertEquals(schema1, version1);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void getAllVersionSchema() throws Exception {
         putSchema(schemaId1, schema1, version(0));
         putSchema(schemaId1, schema2, version(1));
@@ -184,7 +184,7 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
         assertEquals(schema3, allSchemas.get(2));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void addLotsOfEntriesThenDelete() throws Exception {
         SchemaData randomSchema1 = randomSchema();
         SchemaData randomSchema2 = randomSchema();
@@ -230,7 +230,7 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void writeSchemasToDifferentIds() throws Exception {
         SchemaData schemaWithDifferentId = schema3;
 
@@ -245,7 +245,7 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
         assertEquals(schema3, withDifferentId);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void dontReAddExistingSchemaAtRoot() throws Exception {
         putSchema(schemaId1, schema1, version(0));
         putSchema(schemaId1, schema1, version(0));
@@ -253,7 +253,7 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
     }
 
 
-    @Test
+    @Test(timeOut = 10000)
     public void trimDeletedSchemaAndGetListTest() throws Exception {
         List<SchemaAndMetadata> list = new ArrayList<>();
         CompletableFuture<SchemaVersion> put = schemaRegistryService.putSchemaIfAbsent(
@@ -278,7 +278,7 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void dontReAddExistingSchemaInMiddle() throws Exception {
         putSchema(schemaId1, randomSchema(), version(0));
         putSchema(schemaId1, schema2, version(1));
@@ -289,7 +289,7 @@ public class SchemaServiceTest extends MockedPulsarServiceBaseTest {
         putSchema(schemaId1, schema2, version(1));
     }
 
-    @Test(expectedExceptions = ExecutionException.class)
+    @Test(timeOut = 10000, expectedExceptions = ExecutionException.class)
     public void checkIsCompatible() throws Exception {
         String schemaJson1 =
                 "{\"type\":\"record\",\"name\":\"DefaultTest\",\"namespace\":\"org.apache.pulsar.broker.service.schema" +
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/validator/SchemaDataValidatorTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/validator/SchemaDataValidatorTest.java
index 998d363..94d2888 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/validator/SchemaDataValidatorTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/validator/SchemaDataValidatorTest.java
@@ -71,7 +71,7 @@ public class SchemaDataValidatorTest {
         };
     }
 
-    @Test(dataProvider = "primitiveSchemas")
+    @Test(timeOut = 10000, dataProvider = "primitiveSchemas")
     public void testPrimitiveValidatorSuccess(SchemaType type) throws Exception {
         SchemaData data = SchemaData.builder()
             .type(type)
@@ -80,7 +80,7 @@ public class SchemaDataValidatorTest {
         SchemaDataValidator.validateSchemaData(data);
     }
 
-    @Test(dataProvider = "primitiveSchemas", expectedExceptions = InvalidSchemaDataException.class)
+    @Test(timeOut = 10000, dataProvider = "primitiveSchemas", expectedExceptions = InvalidSchemaDataException.class)
     public void testPrimitiveValidatorInvalid(SchemaType type) throws Exception {
         SchemaData data = SchemaData.builder()
             .type(type)
@@ -89,7 +89,7 @@ public class SchemaDataValidatorTest {
         SchemaDataValidator.validateSchemaData(data);
     }
 
-    @Test(dataProvider = "clientSchemas", expectedExceptions = InvalidSchemaDataException.class)
+    @Test(timeOut = 10000, dataProvider = "clientSchemas", expectedExceptions = InvalidSchemaDataException.class)
     public void testValidateClientSchemas(SchemaType type) throws Exception {
         SchemaData data = SchemaData.builder()
             .type(type)
@@ -98,7 +98,7 @@ public class SchemaDataValidatorTest {
         SchemaDataValidator.validateSchemaData(data);
     }
 
-    @Test(dataProvider = "structSchemas")
+    @Test(timeOut = 10000, dataProvider = "structSchemas")
     public void testStructValidatorSuccess(SchemaType type) throws Exception {
         Schema<Foo> schema = Schema.AVRO(Foo.class);
         SchemaData data = SchemaData.builder()
@@ -108,7 +108,7 @@ public class SchemaDataValidatorTest {
         SchemaDataValidator.validateSchemaData(data);
     }
 
-    @Test(dataProvider = "structSchemas", expectedExceptions = InvalidSchemaDataException.class)
+    @Test(timeOut = 10000, dataProvider = "structSchemas", expectedExceptions = InvalidSchemaDataException.class)
     public void testStructValidatorInvalid(SchemaType type) throws Exception {
         SchemaData data = SchemaData.builder()
             .type(type)
@@ -117,7 +117,7 @@ public class SchemaDataValidatorTest {
         SchemaDataValidator.validateSchemaData(data);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testJsonSchemaTypeWithJsonSchemaData() throws Exception {
         ObjectMapper mapper = ObjectMapperFactory.getThreadLocal();
         SchemaData data = SchemaData.builder()
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/validator/SchemaRegistryServiceWithSchemaDataValidatorTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/validator/SchemaRegistryServiceWithSchemaDataValidatorTest.java
index 885a9e9..135cba9 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/validator/SchemaRegistryServiceWithSchemaDataValidatorTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/service/schema/validator/SchemaRegistryServiceWithSchemaDataValidatorTest.java
@@ -48,13 +48,13 @@ public class SchemaRegistryServiceWithSchemaDataValidatorTest {
     private SchemaRegistryService underlyingService;
     private SchemaRegistryServiceWithSchemaDataValidator service;
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void setup() {
         this.underlyingService = mock(SchemaRegistryService.class);
         this.service = SchemaRegistryServiceWithSchemaDataValidator.of(underlyingService);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetLatestSchema() {
         String schemaId = "test-schema-id";
         CompletableFuture<SchemaAndMetadata> getFuture = new CompletableFuture<>();
@@ -63,7 +63,7 @@ public class SchemaRegistryServiceWithSchemaDataValidatorTest {
         verify(underlyingService, times(1)).getSchema(eq(schemaId));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetSchemaByVersion() {
         String schemaId = "test-schema-id";
         CompletableFuture<SchemaAndMetadata> getFuture = new CompletableFuture<>();
@@ -74,7 +74,7 @@ public class SchemaRegistryServiceWithSchemaDataValidatorTest {
             .getSchema(eq(schemaId), same(SchemaVersion.Latest));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDeleteSchema() {
         String schemaId = "test-schema-id";
         String user = "test-user";
@@ -86,7 +86,7 @@ public class SchemaRegistryServiceWithSchemaDataValidatorTest {
             .deleteSchema(eq(schemaId), eq(user));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testIsCompatibleWithGoodSchemaData() {
         String schemaId = "test-schema-id";
         SchemaCompatibilityStrategy strategy = SchemaCompatibilityStrategy.FULL;
@@ -102,7 +102,7 @@ public class SchemaRegistryServiceWithSchemaDataValidatorTest {
             .isCompatible(eq(schemaId), same(schemaData), eq(strategy));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testIsCompatibleWithBadSchemaData() {
         String schemaId = "test-schema-id";
         SchemaCompatibilityStrategy strategy = SchemaCompatibilityStrategy.FULL;
@@ -123,7 +123,7 @@ public class SchemaRegistryServiceWithSchemaDataValidatorTest {
             .isCompatible(eq(schemaId), same(schemaData), eq(strategy));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPutSchemaIfAbsentWithGoodSchemaData() {
         String schemaId = "test-schema-id";
         SchemaCompatibilityStrategy strategy = SchemaCompatibilityStrategy.FULL;
@@ -139,7 +139,7 @@ public class SchemaRegistryServiceWithSchemaDataValidatorTest {
             .putSchemaIfAbsent(eq(schemaId), same(schemaData), eq(strategy));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPutSchemaIfAbsentWithBadSchemaData() {
         String schemaId = "test-schema-id";
         SchemaCompatibilityStrategy strategy = SchemaCompatibilityStrategy.FULL;
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/BookieClientsStatsGeneratorTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/BookieClientsStatsGeneratorTest.java
index 67733a6..be44d21 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/BookieClientsStatsGeneratorTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/BookieClientsStatsGeneratorTest.java
@@ -37,26 +37,26 @@ import io.netty.buffer.PooledByteBufAllocator;
  */
 public class BookieClientsStatsGeneratorTest extends BrokerTestBase {
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBookieClientStatsGenerator() throws Exception {
         // should not generate any NPE or other exceptions..
         Map<String, Map<String, PendingBookieOpsStats>> stats = BookieClientStatsGenerator.generate(super.getPulsar());
         assertTrue(stats.isEmpty());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testJvmDirectMemoryUsedMetric() throws Exception {
         PooledByteBufAllocator allocator = new PooledByteBufAllocator( //
                 true, // preferDirect
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/ManagedLedgerMetricsTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/ManagedLedgerMetricsTest.java
index f74f192..5f0692e 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/ManagedLedgerMetricsTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/ManagedLedgerMetricsTest.java
@@ -38,19 +38,19 @@ import org.testng.annotations.Test;
  */
 public class ManagedLedgerMetricsTest extends BrokerTestBase {
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testManagedLedgerMetrics() throws Exception {
         ManagedLedgerMetrics metrics = new ManagedLedgerMetrics(pulsar);
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java
index ac8e802..24537f3 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/PrometheusMetricsTest.java
@@ -42,19 +42,19 @@ import com.google.common.collect.ArrayListMultimap;
 import com.google.common.collect.Multimap;
 
 public class PrometheusMetricsTest extends BrokerTestBase {
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     @Override
     protected void setup() throws Exception {
         super.baseSetup();
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPerTopicStats() throws Exception {
         Producer<byte[]> p1 = pulsarClient.newProducer().topic("persistent://my-property/use/my-ns/my-topic1").create();
         Producer<byte[]> p2 = pulsarClient.newProducer().topic("persistent://my-property/use/my-ns/my-topic2").create();
@@ -100,7 +100,7 @@ public class PrometheusMetricsTest extends BrokerTestBase {
         p2.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPerNamespaceStats() throws Exception {
         Producer<byte[]> p1 = pulsarClient.newProducer().topic("persistent://my-property/use/my-ns/my-topic1").create();
         Producer<byte[]> p2 = pulsarClient.newProducer().topic("persistent://my-property/use/my-ns/my-topic2").create();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/prometheus/AggregatedNamespaceStatsTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/prometheus/AggregatedNamespaceStatsTest.java
index bb010a6..523be85 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/prometheus/AggregatedNamespaceStatsTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/prometheus/AggregatedNamespaceStatsTest.java
@@ -25,7 +25,7 @@ import org.testng.annotations.Test;
 
 public class AggregatedNamespaceStatsTest {
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSimpleAggregation() throws Exception {
         final String namespace = "tenant/cluster/ns";
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/InMemTransactionBufferReaderTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/InMemTransactionBufferReaderTest.java
index e2af027..84534ee 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/InMemTransactionBufferReaderTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/InMemTransactionBufferReaderTest.java
@@ -45,7 +45,7 @@ public class InMemTransactionBufferReaderTest {
 
     private final TxnID txnID = new TxnID(1234L, 5678L);
 
-    @Test
+    @Test(timeOut = 10000)
     public void testInvalidNumEntriesArgument() {
         try (InMemTransactionBufferReader reader = new InMemTransactionBufferReader(
             txnID,
@@ -62,7 +62,7 @@ public class InMemTransactionBufferReaderTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCloseReleaseAllEntries() throws Exception {
         SortedMap<Long, ByteBuf> entries = new TreeMap<>();
         final int numEntries = 100;
@@ -88,7 +88,7 @@ public class InMemTransactionBufferReaderTest {
         verifyEntriesReleased(entries, 10L, numEntries - 10);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testEndOfTransactionException() throws Exception {
         SortedMap<Long, ByteBuf> entries = new TreeMap<>();
         final int numEntries = 100;
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/PersistentTransactionBufferTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/PersistentTransactionBufferTest.java
index 82982a1..7844871 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/PersistentTransactionBufferTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/PersistentTransactionBufferTest.java
@@ -116,7 +116,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
     final String successTopicName = "persistent://prop/use/ns-abc/successTopic_txn";
     private static final Logger log = LoggerFactory.getLogger(PersistentTransactionBufferTest.class);
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void setup() throws Exception {
         ServiceConfiguration svcConfig = spy(new ServiceConfiguration());
         pulsar = spy(new PulsarService(svcConfig));
@@ -311,7 +311,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
         this.buffer = new PersistentTransactionBuffer(successTopicName, factory.open("hello"), brokerService);
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     public void teardown() throws Exception {
         brokerService.getTopics().clear();
         brokerService.close(); //to clear pulsarStats
@@ -326,7 +326,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
     private final TxnID txnID = new TxnID(1234L, 5678L);
     private PersistentTransactionBuffer buffer;
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetANonExistTxn() throws InterruptedException {
         try {
             buffer.getTransactionMeta(txnID).get();
@@ -335,7 +335,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOpenReaderOnNonExistentTxn() throws InterruptedException{
         try {
             buffer.openTransactionBufferReader(txnID, 0L).get();
@@ -344,7 +344,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOpenReadOnAnOpenTxn() throws InterruptedException {
         final int numEntries = 10;
         appendEntries(buffer, txnID, numEntries, 0L);
@@ -365,7 +365,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOpenReaderOnCommittedTxn() throws ExecutionException, InterruptedException {
         final int numEntries = 10;
         appendEntries(buffer, txnID, numEntries, 0L);
@@ -391,7 +391,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCommitNonExistentTxn() throws ExecutionException, InterruptedException {
         try {
             buffer.commitTxn(txnID, 22L, 33L).get();
@@ -400,7 +400,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCommitTxn() throws Exception {
         final int numEntries = 10;
         appendEntries(buffer, txnID, numEntries, 0L);
@@ -416,7 +416,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
         assertEquals(meta.status(), TxnStatus.COMMITTED);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCommitTxnMultiTimes() throws ExecutionException, InterruptedException {
         final int numEntries = 10;
         appendEntries(buffer, txnID, numEntries, 0L);
@@ -441,7 +441,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
         assertEquals(meta.numEntries(), numEntries);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAbortNonExistentTxn() throws Exception {
         try {
             buffer.abortTxn(txnID).get();
@@ -451,7 +451,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAbortCommittedTxn() throws Exception {
         final int numEntries = 10;
         appendEntries(buffer, txnID, numEntries, 0L);
@@ -476,7 +476,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
         assertEquals(TxnStatus.COMMITTED, meta.status());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAbortTxn() throws Exception {
         final int numEntries = 10;
         appendEntries(buffer, txnID, numEntries, 0L);
@@ -488,7 +488,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
         verifyTxnNotExist(txnID);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPurgeTxns() throws Exception {
         final int numEntries = 10;
         TxnID txnId1 = new TxnID(1234L, 2345L);
@@ -541,7 +541,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
         assertEquals(TxnStatus.COMMITTED, meta3.status());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAppendEntry() throws ExecutionException, InterruptedException, ManagedLedgerException,
                                          BrokerServiceException.NamingException {
         ManagedLedger ledger = factory.open("test_ledger");
@@ -567,7 +567,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
         verifyEntries(ledger, copy, meta.getEntries());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCommitMarker() throws Exception {
         ManagedLedger ledger = factory.open("test_commit_ledger");
         PersistentTransactionBuffer commitBuffer = new PersistentTransactionBuffer(successTopicName, ledger,
@@ -595,7 +595,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAbortMarker() throws Exception {
         ManagedLedger ledger = factory.open("test_abort_ledger");
         PersistentTransactionBuffer abortBuffer = new PersistentTransactionBuffer(successTopicName, ledger,
@@ -642,7 +642,7 @@ public class PersistentTransactionBufferTest extends MockedBookKeeperTestCase {
         return readEntry.get(0);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testNoDeduplicateMessage()
         throws ManagedLedgerException, InterruptedException, BrokerServiceException.NamingException,
                ExecutionException {
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/TransactionBufferTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/TransactionBufferTest.java
index 0724a68..0c5aa1d 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/TransactionBufferTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/TransactionBufferTest.java
@@ -63,17 +63,17 @@ public class TransactionBufferTest {
         this.provider = TransactionBufferProvider.newProvider(providerClassName);
     }
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void setup() throws Exception {
         this.buffer = this.provider.newTransactionBuffer().get();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     public void teardown() throws Exception {
         this.buffer.closeAsync();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOpenReaderOnNonExistentTxn() throws Exception {
         try {
             buffer.openTransactionBufferReader(txnId, 0L).get();
@@ -83,7 +83,7 @@ public class TransactionBufferTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOpenReaderOnAnOpenTxn() throws Exception {
         final int numEntries = 10;
         appendEntries(txnId, numEntries, 0L);
@@ -99,7 +99,7 @@ public class TransactionBufferTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOpenReaderOnCommittedTxn() throws Exception {
         final int numEntries = 10;
         appendEntries(txnId, numEntries, 0L);
@@ -123,7 +123,7 @@ public class TransactionBufferTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCommitNonExistentTxn() throws Exception {
         try {
             buffer.commitTxn(txnId, 22L, 33L).get();
@@ -133,7 +133,7 @@ public class TransactionBufferTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCommitTxn() throws Exception {
         final int numEntries = 10;
         appendEntries(txnId, numEntries, 0L);
@@ -147,7 +147,7 @@ public class TransactionBufferTest {
         assertEquals(TxnStatus.COMMITTED, txnMeta.status());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAbortNonExistentTxn() throws Exception {
         try {
             buffer.abortTxn(txnId).get();
@@ -157,7 +157,7 @@ public class TransactionBufferTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAbortCommittedTxn() throws Exception {
         final int numEntries = 10;
         appendEntries(txnId, numEntries, 0L);
@@ -181,7 +181,7 @@ public class TransactionBufferTest {
         assertEquals(TxnStatus.COMMITTED, txnMeta.status());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAbortTxn() throws Exception {
         final int numEntries = 10;
         appendEntries(txnId, numEntries, 0L);
@@ -193,7 +193,7 @@ public class TransactionBufferTest {
         verifyTxnNotExist(txnId);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPurgeTxns() throws Exception {
         final int numEntries = 10;
         // create an OPEN txn
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/TransactionEntryImplTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/TransactionEntryImplTest.java
index afb4fea..3c107ac 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/TransactionEntryImplTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/transaction/buffer/TransactionEntryImplTest.java
@@ -32,7 +32,7 @@ import org.testng.annotations.Test;
  */
 public class TransactionEntryImplTest {
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCloseShouldReleaseBuffer() {
         ByteBuf buffer = Unpooled.copiedBuffer("test-value", UTF_8);
         TransactionEntryImpl entry = new TransactionEntryImpl(
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/web/RestExceptionTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/web/RestExceptionTest.java
index cf9e952..10e1eac 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/web/RestExceptionTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/web/RestExceptionTest.java
@@ -29,7 +29,7 @@ import org.testng.annotations.Test;
  */
 public class RestExceptionTest {
 
-    @Test
+    @Test(timeOut = 10000)
     public void testRestException() {
         RestException re = new RestException(Status.TEMPORARY_REDIRECT, "test rest exception");
         RestException testException = new RestException(re);
@@ -38,7 +38,7 @@ public class RestExceptionTest {
         assertEquals(re.getResponse().getEntity(), testException.getResponse().getEntity());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testWebApplicationException() {
         WebApplicationException wae = new WebApplicationException("test web application exception", Status.TEMPORARY_REDIRECT);
         RestException testException = new RestException(wae);
@@ -47,7 +47,7 @@ public class RestExceptionTest {
         assertEquals(wae.getResponse().getEntity(), testException.getResponse().getEntity());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testOtherException() {
         Exception otherException = new Exception("test other exception");
         RestException testException = new RestException(otherException);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/web/WebServiceTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/web/WebServiceTest.java
index f0856b6..f527578 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/web/WebServiceTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/web/WebServiceTest.java
@@ -89,7 +89,7 @@ public class WebServiceTest {
      * allowUnversionedClients to true, then making a request with no version, which should go through.
      *
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testDefaultClientVersion() throws Exception {
         setupEnv(true, "1.0", true, false, false, false);
 
@@ -107,7 +107,7 @@ public class WebServiceTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testTlsEnabled() throws Exception {
         setupEnv(false, "1.0", false, true, false, false);
 
@@ -129,7 +129,7 @@ public class WebServiceTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testTlsDisabled() throws Exception {
         setupEnv(false, "1.0", false, false, false, false);
 
@@ -153,7 +153,7 @@ public class WebServiceTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testTlsAuthAllowInsecure() throws Exception {
         setupEnv(false, "1.0", false, true, true, true);
 
@@ -176,7 +176,7 @@ public class WebServiceTest {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testTlsAuthDisallowInsecure() throws Exception {
         setupEnv(false, "1.0", false, true, true, false);
 
@@ -194,7 +194,7 @@ public class WebServiceTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSplitPath() {
         String result = PulsarWebResource.splitPath("prop/cluster/ns/topic1", 4);
         Assert.assertEquals(result, "topic1");
@@ -295,7 +295,7 @@ public class WebServiceTest {
         }
     }
 
-    @AfterMethod(alwaysRun = true)
+    @AfterMethod( timeOut = 10000, alwaysRun = true)
     void teardown() throws Exception {
         try {
             pulsar.close();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/zookeeper/ZooKeeperClientAspectJTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/zookeeper/ZooKeeperClientAspectJTest.java
index 4abfa13..eaa4a6e 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/zookeeper/ZooKeeperClientAspectJTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/zookeeper/ZooKeeperClientAspectJTest.java
@@ -81,7 +81,7 @@ public class ZooKeeperClientAspectJTest {
         // AgentLoader.loadAgentClass(Agent.class.getName(), null);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testZkConnected() throws Exception {
         OrderedScheduler executor = OrderedScheduler.newSchedulerBuilder().build();
         try {
@@ -100,7 +100,7 @@ public class ZooKeeperClientAspectJTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testInitZk() throws Exception {
         try {
             ZooKeeperClientFactory zkfactory = new ZookeeperClientFactoryImpl();
@@ -124,13 +124,13 @@ public class ZooKeeperClientAspectJTest {
         }
     }
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     void setup() throws Exception {
         localZkS = new ZookeeperServerTest(LOCAL_ZOOKEEPER_PORT);
         localZkS.start();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     void teardown() throws Exception {
         localZkS.close();
     }
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/zookeeper/ZooKeeperSessionExpireRecoveryTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/zookeeper/ZooKeeperSessionExpireRecoveryTest.java
index 0ac89e4..f36b95e 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/zookeeper/ZooKeeperSessionExpireRecoveryTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/zookeeper/ZooKeeperSessionExpireRecoveryTest.java
@@ -33,13 +33,13 @@ import com.google.common.collect.Sets;
 
 public class ZooKeeperSessionExpireRecoveryTest extends MockedPulsarServiceBaseTest {
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -48,7 +48,7 @@ public class ZooKeeperSessionExpireRecoveryTest extends MockedPulsarServiceBaseT
     /**
      * Verify we are able to recover when receiving a SessionExpired event on global ZK session
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testSessionExpired() throws Exception {
         admin.clusters().createCluster("my-cluster", new ClusterData("test-url"));
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthenticatedProducerConsumerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthenticatedProducerConsumerTest.java
index f328edc..5ddf18a 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthenticatedProducerConsumerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthenticatedProducerConsumerTest.java
@@ -62,7 +62,7 @@ public class AuthenticatedProducerConsumerTest extends ProducerConsumerBase {
 
     private final String BASIC_CONF_FILE_PATH = "./src/test/resources/authentication/basic/.htpasswd";
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         if (methodName.equals("testAnonymousSyncProducerAndConsumer")) {
@@ -116,7 +116,7 @@ public class AuthenticatedProducerConsumerTest extends ProducerConsumerBase {
                 .enableTls(true).build();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -159,7 +159,7 @@ public class AuthenticatedProducerConsumerTest extends ProducerConsumerBase {
         consumer.close();
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testTlsSyncProducerAndConsumer(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -181,7 +181,7 @@ public class AuthenticatedProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testBasicCryptSyncProducerAndConsumer(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
         AuthenticationBasic authPassword = new AuthenticationBasic();
@@ -199,7 +199,7 @@ public class AuthenticatedProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testBasicArp1SyncProducerAndConsumer(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
         AuthenticationBasic authPassword = new AuthenticationBasic();
@@ -217,7 +217,7 @@ public class AuthenticatedProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testAnonymousSyncProducerAndConsumer(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -265,7 +265,7 @@ public class AuthenticatedProducerConsumerTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testAuthenticationFilterNegative() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -296,7 +296,7 @@ public class AuthenticatedProducerConsumerTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testInternalServerExceptionOnLookup() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthenticationTlsHostnameVerificationTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthenticationTlsHostnameVerificationTest.java
index 37db6ac..e8436ac 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthenticationTlsHostnameVerificationTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthenticationTlsHostnameVerificationTest.java
@@ -124,7 +124,7 @@ public class AuthenticationTlsHostnameVerificationTest extends ProducerConsumerB
         admin.namespaces().createNamespace("my-property/my-ns", Sets.newHashSet("test"));
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         if (!methodName.equals("testDefaultHostVerifier")) {
@@ -148,7 +148,7 @@ public class AuthenticationTlsHostnameVerificationTest extends ProducerConsumerB
      *
      * @throws Exception
      */
-    @Test(dataProvider = "hostnameVerification")
+    @Test(timeOut = 10000, dataProvider = "hostnameVerification")
     public void testTlsSyncProducerAndConsumerWithInvalidBrokerHost(boolean hostnameVerificationEnabled)
             throws Exception {
         log.info("-- Starting {} test --", methodName);
@@ -191,7 +191,7 @@ public class AuthenticationTlsHostnameVerificationTest extends ProducerConsumerB
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testTlsSyncProducerAndConsumerCorrectBrokerHost() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -235,7 +235,7 @@ public class AuthenticationTlsHostnameVerificationTest extends ProducerConsumerB
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testDefaultHostVerifier() throws Exception {
         log.info("-- Starting {} test --", methodName);
         Method matchIdentityStrict = DefaultHostnameVerifier.class.getDeclaredMethod("matchIdentityStrict",
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthorizationProducerConsumerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthorizationProducerConsumerTest.java
index 91cec49..9f5bc53 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthorizationProducerConsumerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/AuthorizationProducerConsumerTest.java
@@ -80,7 +80,7 @@ public class AuthorizationProducerConsumerTest extends ProducerConsumerBase {
         super.init();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -97,7 +97,7 @@ public class AuthorizationProducerConsumerTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testProducerAndConsumerAuthorization() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -151,7 +151,7 @@ public class AuthorizationProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSubscriberPermission() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -248,7 +248,7 @@ public class AuthorizationProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
     
-    @Test
+    @Test(timeOut = 10000)
     public void testSubscriptionPrefixAuthorization() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -289,7 +289,7 @@ public class AuthorizationProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGrantPermission() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -308,7 +308,7 @@ public class AuthorizationProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAuthData() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/BrokerServiceLookupTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/BrokerServiceLookupTest.java
index ec83272..83372be 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/BrokerServiceLookupTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/BrokerServiceLookupTest.java
@@ -108,7 +108,7 @@ import lombok.Cleanup;
 public class BrokerServiceLookupTest extends ProducerConsumerBase {
     private static final Logger log = LoggerFactory.getLogger(BrokerServiceLookupTest.class);
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         conf.setDefaultNumberOfNamespaceBundles(1);
@@ -119,7 +119,7 @@ public class BrokerServiceLookupTest extends ProducerConsumerBase {
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -135,7 +135,7 @@ public class BrokerServiceLookupTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMultipleBrokerLookup() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -211,7 +211,7 @@ public class BrokerServiceLookupTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMultipleBrokerDifferentClusterLookup() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -296,7 +296,7 @@ public class BrokerServiceLookupTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 20000)
     public void testPartitionTopicLookup() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -371,7 +371,7 @@ public class BrokerServiceLookupTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 20000)
     public void testWebserviceServiceTls() throws Exception {
         log.info("-- Starting {} test --", methodName);
         final String TLS_SERVER_CERT_FILE_PATH = "./src/test/resources/certificate/server.crt";
@@ -471,7 +471,7 @@ public class BrokerServiceLookupTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 20000)
     public void testDiscoveryLookup() throws Exception {
 
         // (1) start discovery service
@@ -518,7 +518,7 @@ public class BrokerServiceLookupTest extends ProducerConsumerBase {
      * @throws Exception
      */
     @SuppressWarnings("deprecation")
-    @Test
+    @Test(timeOut = 20000)
     public void testDiscoveryLookupTls() throws Exception {
 
         final String TLS_SERVER_CERT_FILE_PATH = "./src/test/resources/certificate/server.crt";
@@ -584,7 +584,7 @@ public class BrokerServiceLookupTest extends ProducerConsumerBase {
 
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testDiscoveryLookupAuthAndAuthSuccess() throws Exception {
 
         // (1) start discovery service
@@ -657,7 +657,7 @@ public class BrokerServiceLookupTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testDiscoveryLookupAuthenticationFailure() throws Exception {
 
         // (1) start discovery service
@@ -716,7 +716,7 @@ public class BrokerServiceLookupTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testDiscoveryLookupAuthorizationFailure() throws Exception {
 
         // (1) start discovery service
@@ -794,7 +794,7 @@ public class BrokerServiceLookupTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test(timeOut = 5000)
+    @Test(timeOut = 10000)
     public void testSplitUnloadLookupTest() throws Exception {
 
         log.info("-- Starting {} test --", methodName);
@@ -896,7 +896,7 @@ public class BrokerServiceLookupTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test(timeOut = 10000)
+    @Test(timeOut = 20000)
     public void testModularLoadManagerSplitBundle() throws Exception {
 
         log.info("-- Starting {} test --", methodName);
@@ -1011,7 +1011,7 @@ public class BrokerServiceLookupTest extends ProducerConsumerBase {
         }
     }
 
-    @Test(timeOut = 10000)
+    @Test(timeOut = 20000)
     public void testPartitionedMetadataWithDeprecatedVersion() throws Exception {
 
         final String cluster = "use2";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/BytesKeyTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/BytesKeyTest.java
index 3fa8a3a..37da69b 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/BytesKeyTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/BytesKeyTest.java
@@ -28,14 +28,14 @@ import org.testng.annotations.Test;
 
 public class BytesKeyTest extends ProducerConsumerBase {
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -64,12 +64,12 @@ public class BytesKeyTest extends ProducerConsumerBase {
         Assert.assertTrue(m.hasBase64EncodedKey());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBytesKeyBatch() throws Exception {
         byteKeysTest(true);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBytesKeyNoBatch() throws Exception {
         byteKeysTest(false);
     }
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ClientDeduplicationTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ClientDeduplicationTest.java
index 03f12b4..911403e 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ClientDeduplicationTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ClientDeduplicationTest.java
@@ -28,20 +28,20 @@ import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 
 public class ClientDeduplicationTest extends ProducerConsumerBase {
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProducerSequenceAfterReconnect() throws Exception {
         String topic = "persistent://my-property/my-ns/testProducerSequenceAfterReconnect";
         admin.namespaces().setDeduplicationStatus("my-property/my-ns", true);
@@ -72,7 +72,7 @@ public class ClientDeduplicationTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProducerSequenceAfterRestart() throws Exception {
         String topic = "persistent://my-property/my-ns/testProducerSequenceAfterRestart";
         admin.namespaces().setDeduplicationStatus("my-property/my-ns", true);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ClientErrorsTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ClientErrorsTest.java
index f8ac75b..5ed968a 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ClientErrorsTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ClientErrorsTest.java
@@ -53,19 +53,19 @@ public class ClientErrorsTest {
 
     private final String ASSERTION_ERROR = "AssertionError";
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     public void setup() {
         mockBrokerService = new MockBrokerService(WEB_SERVICE_PORT, WEB_SERVICE_TLS_PORT, BROKER_SERVICE_PORT,
                 BROKER_SERVICE_TLS_PORT);
         mockBrokerService.start();
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     public void teardown() {
         mockBrokerService.stop();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMockBrokerService() throws Exception {
         // test default actions of mock broker service
         try {
@@ -89,12 +89,12 @@ public class ClientErrorsTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProducerCreateFailWithoutRetry() throws Exception {
         producerCreateFailWithoutRetry("persistent://prop/use/ns/t1");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPartitionedProducerCreateFailWithoutRetry() throws Exception {
         producerCreateFailWithoutRetry("persistent://prop/use/ns/part-t1");
     }
@@ -125,12 +125,12 @@ public class ClientErrorsTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProducerCreateSuccessAfterRetry() throws Exception {
         producerCreateSuccessAfterRetry("persistent://prop/use/ns/t1");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPartitionedProducerCreateSuccessAfterRetry() throws Exception {
         producerCreateSuccessAfterRetry("persistent://prop/use/ns/part-t1");
     }
@@ -157,12 +157,12 @@ public class ClientErrorsTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProducerCreateFailAfterRetryTimeout() throws Exception {
         producerCreateFailAfterRetryTimeout("persistent://prop/use/ns/t1");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPartitionedProducerCreateFailAfterRetryTimeout() throws Exception {
         producerCreateFailAfterRetryTimeout("persistent://prop/use/ns/part-t1");
     }
@@ -195,12 +195,12 @@ public class ClientErrorsTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProducerFailDoesNotFailOtherProducer() throws Exception {
         producerFailDoesNotFailOtherProducer("persistent://prop/use/ns/t1", "persistent://prop/use/ns/t2");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPartitionedProducerFailDoesNotFailOtherProducer() throws Exception {
         producerFailDoesNotFailOtherProducer("persistent://prop/use/ns/part-t1", "persistent://prop/use/ns/part-t2");
     }
@@ -236,12 +236,12 @@ public class ClientErrorsTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProducerContinuousRetryAfterSendFail() throws Exception {
         producerContinuousRetryAfterSendFail("persistent://prop/use/ns/t1");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPartitionedProducerContinuousRetryAfterSendFail() throws Exception {
         producerContinuousRetryAfterSendFail("persistent://prop/use/ns/part-t1");
     }
@@ -282,17 +282,17 @@ public class ClientErrorsTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSubscribeFailWithoutRetry() throws Exception {
         subscribeFailWithoutRetry("persistent://prop/use/ns/t1");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPartitionedSubscribeFailWithoutRetry() throws Exception {
         subscribeFailWithoutRetry("persistent://prop/use/ns/part-t1");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testLookupWithDisconnection() throws Exception {
         final String brokerUrl = "pulsar://127.0.0.1:" + BROKER_SERVICE_PORT;
         PulsarClient client = PulsarClient.builder().serviceUrl(brokerUrl).build();
@@ -353,12 +353,12 @@ public class ClientErrorsTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSubscribeSuccessAfterRetry() throws Exception {
         subscribeSuccessAfterRetry("persistent://prop/use/ns/t1");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPartitionedSubscribeSuccessAfterRetry() throws Exception {
         subscribeSuccessAfterRetry("persistent://prop/use/ns/part-t1");
     }
@@ -385,12 +385,12 @@ public class ClientErrorsTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSubscribeFailAfterRetryTimeout() throws Exception {
         subscribeFailAfterRetryTimeout("persistent://prop/use/ns/t1");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPartitionedSubscribeFailAfterRetryTimeout() throws Exception {
         subscribeFailAfterRetryTimeout("persistent://prop/use/ns/part-t1");
     }
@@ -423,12 +423,12 @@ public class ClientErrorsTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSubscribeFailDoesNotFailOtherConsumer() throws Exception {
         subscribeFailDoesNotFailOtherConsumer("persistent://prop/use/ns/t1", "persistent://prop/use/ns/t2");
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPartitionedSubscribeFailDoesNotFailOtherConsumer() throws Exception {
         subscribeFailDoesNotFailOtherConsumer("persistent://prop/use/ns/part-t1", "persistent://prop/use/ns/part-t2");
     }
@@ -467,7 +467,7 @@ public class ClientErrorsTest {
 
     // if a producer fails to connect while creating partitioned producer, it should close all successful connections of
     // other producers and fail
-    @Test
+    @Test(timeOut = 10000)
     public void testOneProducerFailShouldCloseAllProducersInPartitionedProducer() throws Exception {
         PulsarClient client = PulsarClient.builder().serviceUrl("http://127.0.0.1:" + WEB_SERVICE_PORT).build();
         final AtomicInteger producerCounter = new AtomicInteger(0);
@@ -502,7 +502,7 @@ public class ClientErrorsTest {
 
     // if a consumer fails to subscribe while creating partitioned consumer, it should close all successful connections
     // of other consumers and fail
-    @Test
+    @Test(timeOut = 10000)
     public void testOneConsumerFailShouldCloseAllConsumersInPartitionedConsumer() throws Exception {
         PulsarClient client = PulsarClient.builder().serviceUrl("http://127.0.0.1:" + WEB_SERVICE_PORT).build();
         final AtomicInteger subscribeCounter = new AtomicInteger(0);
@@ -536,7 +536,7 @@ public class ClientErrorsTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testFlowSendWhenPartitionedSubscribeCompletes() throws Exception {
         PulsarClient client = PulsarClient.builder().serviceUrl("http://127.0.0.1:" + WEB_SERVICE_PORT).build();
 
@@ -567,7 +567,7 @@ public class ClientErrorsTest {
     }
 
     // Run this test multiple times to reproduce race conditions on reconnection logic
-    @Test(invocationCount = 10)
+    @Test(timeOut = 10000, invocationCount = 10)
     public void testProducerReconnect() throws Exception {
         AtomicInteger numOfConnections = new AtomicInteger();
         AtomicReference<ChannelHandlerContext> channelCtx = new AtomicReference<>();
@@ -607,7 +607,7 @@ public class ClientErrorsTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testConsumerReconnect() throws Exception {
         AtomicInteger numOfConnections = new AtomicInteger();
         AtomicReference<ChannelHandlerContext> channelCtx = new AtomicReference<>();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ConsumerRedeliveryTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ConsumerRedeliveryTest.java
index a42d80c..4518336 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ConsumerRedeliveryTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ConsumerRedeliveryTest.java
@@ -38,7 +38,7 @@ import static org.testng.Assert.assertTrue;
 import static org.testng.Assert.assertEquals;
 
 public class ConsumerRedeliveryTest extends ProducerConsumerBase {
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     @Override
     protected void setup() throws Exception {
         conf.setManagedLedgerCacheEvictionFrequency(0.1);
@@ -46,7 +46,7 @@ public class ConsumerRedeliveryTest extends ProducerConsumerBase {
         super.producerBaseSetup();
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -62,7 +62,7 @@ public class ConsumerRedeliveryTest extends ProducerConsumerBase {
      * </pre>
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testOrderedRedelivery() throws Exception {
         String topic = "persistent://my-property/my-ns/redelivery";
 
@@ -128,7 +128,7 @@ public class ConsumerRedeliveryTest extends ProducerConsumerBase {
         consumer2.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUnAckMessageRedeliveryWithReceiveAsync() throws PulsarClientException, ExecutionException, InterruptedException {
         String topic = "persistent://my-property/my-ns/async-unack-redelivery";
         Consumer<String> consumer = pulsarClient.newConsumer(Schema.STRING)
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java
index ca2eadb..fccde78 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/DeadLetterTopicTest.java
@@ -33,20 +33,20 @@ public class DeadLetterTopicTest extends ProducerConsumerBase {
 
     private static final Logger log = LoggerFactory.getLogger(DeadLetterTopicTest.class);
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testDeadLetterTopic() throws Exception {
         final String topic = "persistent://my-property/my-ns/dead-letter-topic";
 
@@ -120,7 +120,7 @@ public class DeadLetterTopicTest extends ProducerConsumerBase {
      * The test is disabled {@link https://github.com/apache/pulsar/issues/2647}.
      * @throws Exception
      */
-    @Test(enabled = false)
+    @Test(timeOut = 10000, enabled = false)
     public void testDeadLetterTopicWithMultiTopic() throws Exception {
         final String topic1 = "persistent://my-property/my-ns/dead-letter-topic-1";
         final String topic2 = "persistent://my-property/my-ns/dead-letter-topic-2";
@@ -199,7 +199,7 @@ public class DeadLetterTopicTest extends ProducerConsumerBase {
         checkConsumer.close();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testDeadLetterTopicByCustomTopicName() throws Exception {
         final String topic = "persistent://my-property/my-ns/dead-letter-topic";
         final int maxRedeliveryCount = 2;
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/DispatcherBlockConsumerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/DispatcherBlockConsumerTest.java
index 208aa37..c62405d 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/DispatcherBlockConsumerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/DispatcherBlockConsumerTest.java
@@ -66,14 +66,14 @@ import com.google.common.collect.Sets;
 public class DispatcherBlockConsumerTest extends ProducerConsumerBase {
     private static final Logger log = LoggerFactory.getLogger(DispatcherBlockConsumerTest.class);
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -296,7 +296,7 @@ public class DispatcherBlockConsumerTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testCloseConsumerBlockedDispatcher() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -514,7 +514,7 @@ public class DispatcherBlockConsumerTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBlockDispatcherStats() throws Exception {
 
         int orginalDispatcherLimit = conf.getMaxUnackedMessagesPerSubscription();
@@ -588,7 +588,7 @@ public class DispatcherBlockConsumerTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test(dataProvider = "gracefulUnload")
+    @Test(timeOut = 10000, dataProvider = "gracefulUnload")
     public void testBrokerSubscriptionRecovery(boolean unloadBundleGracefully) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -872,7 +872,7 @@ public class DispatcherBlockConsumerTest extends ProducerConsumerBase {
      *
      */
     @SuppressWarnings("unchecked")
-    @Test
+    @Test(timeOut = 10000)
     public void testBrokerDispatchBlockAndSubAckBackRequiredMsgs() {
 
         log.info("-- Starting {} test --", methodName);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ExposeMessageRedeliveryCountTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ExposeMessageRedeliveryCountTest.java
index 5156c90..18c4dde 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ExposeMessageRedeliveryCountTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ExposeMessageRedeliveryCountTest.java
@@ -28,14 +28,14 @@ import java.util.concurrent.TimeUnit;
 
 public class ExposeMessageRedeliveryCountTest extends ProducerConsumerBase {
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/InterceptorsTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/InterceptorsTest.java
index 3192981..8481528 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/InterceptorsTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/InterceptorsTest.java
@@ -38,20 +38,20 @@ public class InterceptorsTest extends ProducerConsumerBase {
 
     private static final Logger log = LoggerFactory.getLogger(InterceptorsTest.class);
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testProducerInterceptor() throws PulsarClientException {
         ProducerInterceptor<String> interceptor1 = new ProducerInterceptor<String>() {
             @Override
@@ -117,7 +117,7 @@ public class InterceptorsTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testProducerInterceptorsWithExceptions() throws PulsarClientException {
         ProducerInterceptor<String> interceptor = new ProducerInterceptor<String>() {
             @Override
@@ -145,7 +145,7 @@ public class InterceptorsTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testProducerInterceptorsWithErrors() throws PulsarClientException {
         ProducerInterceptor<String> interceptor = new ProducerInterceptor<String>() {
             @Override
@@ -173,7 +173,7 @@ public class InterceptorsTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 120000)
     public void testConsumerInterceptorWithErrors() throws PulsarClientException {
         ConsumerInterceptor<String> interceptor = new ConsumerInterceptor<String>() {
             @Override
@@ -246,7 +246,7 @@ public class InterceptorsTest extends ProducerConsumerBase {
         consumer2.close();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testConsumerInterceptorWithSingleTopicSubscribe() throws PulsarClientException {
         ConsumerInterceptor<String> interceptor = new ConsumerInterceptor<String>() {
             @Override
@@ -309,7 +309,7 @@ public class InterceptorsTest extends ProducerConsumerBase {
         consumer.close();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testConsumerInterceptorWithMultiTopicSubscribe() throws PulsarClientException {
 
         ConsumerInterceptor<String> interceptor = new ConsumerInterceptor<String>() {
@@ -381,7 +381,7 @@ public class InterceptorsTest extends ProducerConsumerBase {
         consumer.close();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testConsumerInterceptorWithPatternTopicSubscribe() throws PulsarClientException {
 
         ConsumerInterceptor<String> interceptor = new ConsumerInterceptor<String>() {
@@ -453,7 +453,7 @@ public class InterceptorsTest extends ProducerConsumerBase {
         consumer.close();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testConsumerInterceptorForAcknowledgeCumulative() throws PulsarClientException {
 
         List<MessageId> ackHolder = new ArrayList<>();
@@ -529,7 +529,7 @@ public class InterceptorsTest extends ProducerConsumerBase {
         consumer.close();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testConsumerInterceptorForNegativeAcksSend() throws PulsarClientException, InterruptedException {
         final int totalNumOfMessages = 100;
         CountDownLatch latch = new CountDownLatch(totalNumOfMessages / 2);
@@ -599,7 +599,7 @@ public class InterceptorsTest extends ProducerConsumerBase {
         consumer.close();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testConsumerInterceptorForAckTimeoutSend() throws PulsarClientException, InterruptedException {
         final int totalNumOfMessages = 100;
         CountDownLatch latch = new CountDownLatch(totalNumOfMessages / 2);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/KeySharedSubscriptionTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/KeySharedSubscriptionTest.java
index 494a8c8..c772edc 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/KeySharedSubscriptionTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/KeySharedSubscriptionTest.java
@@ -56,20 +56,20 @@ public class KeySharedSubscriptionTest extends ProducerConsumerBase {
         };
     }
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 20000, dataProvider = "batch")
     public void testSendAndReceiveWithHashRangeStickyKeyConsumerSelector(boolean enableBatch) throws PulsarClientException {
         this.conf.setSubscriptionKeySharedEnable(true);
         String topic = "persistent://public/default/key_shared-" + UUID.randomUUID();
@@ -120,7 +120,7 @@ public class KeySharedSubscriptionTest extends ProducerConsumerBase {
         receiveAndCheck(checkList);
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 20000, dataProvider = "batch")
     public void testConsumerCrashSendAndReceiveWithHashRangeStickyKeyConsumerSelector(boolean enableBatch) throws PulsarClientException, InterruptedException {
 
         this.conf.setSubscriptionKeySharedEnable(true);
@@ -192,7 +192,7 @@ public class KeySharedSubscriptionTest extends ProducerConsumerBase {
     }
 
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 20000, dataProvider = "batch")
     public void testNonKeySendAndReceiveWithHashRangeStickyKeyConsumerSelector(boolean enableBatch) throws PulsarClientException {
         this.conf.setSubscriptionKeySharedEnable(true);
         String topic = "persistent://public/default/key_shared_none_key-" + UUID.randomUUID();
@@ -231,7 +231,7 @@ public class KeySharedSubscriptionTest extends ProducerConsumerBase {
         receiveAndCheck(checkList);
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 20000, dataProvider = "batch")
     public void testOrderingKeyWithHashRangeStickyKeyConsumerSelector(boolean enableBatch) throws PulsarClientException {
         this.conf.setSubscriptionKeySharedEnable(true);
         String topic = "persistent://public/default/key_shared_ordering_key-" + UUID.randomUUID();
@@ -283,7 +283,7 @@ public class KeySharedSubscriptionTest extends ProducerConsumerBase {
         receiveAndCheck(checkList);
     }
 
-    @Test(expectedExceptions = PulsarClientException.class)
+    @Test(timeOut = 10000, expectedExceptions = PulsarClientException.class)
     public void testDisableKeySharedSubscription() throws PulsarClientException {
         this.conf.setSubscriptionKeySharedEnable(false);
         String topic = "persistent://public/default/key_shared_disabled";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/MessageDispatchThrottlingTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/MessageDispatchThrottlingTest.java
index cc0f46e..6b5b629 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/MessageDispatchThrottlingTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/MessageDispatchThrottlingTest.java
@@ -44,7 +44,7 @@ import org.testng.annotations.Test;
 public class MessageDispatchThrottlingTest extends ProducerConsumerBase {
     private static final Logger log = LoggerFactory.getLogger(MessageDispatchThrottlingTest.class);
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
@@ -52,7 +52,7 @@ public class MessageDispatchThrottlingTest extends ProducerConsumerBase {
         this.conf.setClusterName("test");
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -97,7 +97,7 @@ public class MessageDispatchThrottlingTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMessageRateDynamicallyChange() throws Exception {
 
         log.info("-- Starting {} test --", methodName);
@@ -229,7 +229,7 @@ public class MessageDispatchThrottlingTest extends ProducerConsumerBase {
      * @param dispatchRateType
      * @throws Exception
      */
-    @Test()
+    @Test(timeOut = 10000)
     public void testClusterMsgByteRateLimitingClusterConfig() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -641,7 +641,7 @@ public class MessageDispatchThrottlingTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testGlobalNamespaceThrottling() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -786,7 +786,7 @@ public class MessageDispatchThrottlingTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testClusterPolicyOverrideConfiguration() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/MutualAuthenticationTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/MutualAuthenticationTest.java
index b247622..3efe47e 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/MutualAuthenticationTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/MutualAuthenticationTest.java
@@ -182,7 +182,7 @@ public class MutualAuthenticationTest extends ProducerConsumerBase {
         }
     }
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         mutualAuth = new MutualAuthentication();
@@ -203,13 +203,13 @@ public class MutualAuthenticationTest extends ProducerConsumerBase {
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAuthentication() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentKeySharedSubscriptionTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentKeySharedSubscriptionTest.java
index f03460d..a1bd3ac 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentKeySharedSubscriptionTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentKeySharedSubscriptionTest.java
@@ -47,20 +47,20 @@ public class NonPersistentKeySharedSubscriptionTest extends ProducerConsumerBase
     private static final List<String> keys = Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9");
 
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testSendAndReceiveWithHashRangeStickyKeyConsumerSelector() throws PulsarClientException {
         this.conf.setSubscriptionKeySharedEnable(true);
         String topic = "non-persistent://public/default/key_shared";
@@ -111,7 +111,7 @@ public class NonPersistentKeySharedSubscriptionTest extends ProducerConsumerBase
         receiveAndCheck(checkList);
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testConsumerCrashSendAndReceiveWithHashRangeStickyKeyConsumerSelector() throws PulsarClientException, InterruptedException {
 
         this.conf.setSubscriptionKeySharedEnable(true);
@@ -182,7 +182,7 @@ public class NonPersistentKeySharedSubscriptionTest extends ProducerConsumerBase
         receiveAndCheck(checkList);
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testNonKeySendAndReceiveWithHashRangeStickyKeyConsumerSelector() throws PulsarClientException {
         this.conf.setSubscriptionKeySharedEnable(true);
         String topic = "non-persistent://public/default/key_shared_none_key";
@@ -221,7 +221,7 @@ public class NonPersistentKeySharedSubscriptionTest extends ProducerConsumerBase
         receiveAndCheck(checkList);
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testOrderingKeyWithHashRangeStickyKeyConsumerSelector() throws PulsarClientException {
         this.conf.setSubscriptionKeySharedEnable(true);
         String topic = "non-persistent://public/default/key_shared_ordering_key";
@@ -273,7 +273,7 @@ public class NonPersistentKeySharedSubscriptionTest extends ProducerConsumerBase
         receiveAndCheck(checkList);
     }
 
-    @Test(expectedExceptions = PulsarClientException.class)
+    @Test(timeOut = 20000, expectedExceptions = PulsarClientException.class)
     public void testDisableKeySharedSubscription() throws PulsarClientException {
         this.conf.setSubscriptionKeySharedEnable(false);
         String topic = "persistent://public/default/key_shared_disabled";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentTopicTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentTopicTest.java
index f70e6a1..90469b4 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentTopicTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentTopicTest.java
@@ -86,20 +86,20 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
                 { ModularLoadManagerImpl.class.getCanonicalName() } };
     }
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test(dataProvider = "subscriptionType")
+    @Test(timeOut = 10000, dataProvider = "subscriptionType")
     public void testNonPersistentTopic(SubscriptionType type) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -138,7 +138,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
 
     }
 
-    @Test(dataProvider = "subscriptionType")
+    @Test(timeOut = 10000, dataProvider = "subscriptionType")
     public void testPartitionedNonPersistentTopic(SubscriptionType type) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -181,7 +181,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
 
     }
 
-    @Test(dataProvider = "subscriptionType")
+    @Test(timeOut = 10000, dataProvider = "subscriptionType")
     public void testPartitionedNonPersistentTopicWithTcpLookup(SubscriptionType type) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -237,7 +237,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
     /**
      * It verifies that broker doesn't dispatch messages if consumer runs out of permits filled out with messages
      */
-    @Test(dataProvider = "subscriptionType")
+    @Test(timeOut = 10000, dataProvider = "subscriptionType")
     public void testConsumerInternalQueueMaxOut(SubscriptionType type) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -280,7 +280,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
     /**
      * Verifies that broker should failed to publish message if producer publishes messages more than rate limit
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testProducerRateLimit() throws Exception {
         int defaultNonPersistentMessageRate = conf.getMaxConcurrentNonPersistentMessagePerConnection();
         try {
@@ -339,7 +339,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMultipleSubscription() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -418,7 +418,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
     /**
      * verifies that broker is capturing topic stats correctly
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testTopicStats() throws Exception {
 
         final String topicName = "non-persistent://my-property/my-ns/unacked-topic";
@@ -473,7 +473,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
     /**
      * verifies that non-persistent topic replicates using replicator
      */
-    @Test
+    @Test(timeOut = 20000)
     public void testReplicator() throws Exception {
 
         ReplicationClusterManager replication = new ReplicationClusterManager();
@@ -626,7 +626,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
      * 5. Create producer on that topic should fail
      * </pre>
      */
-    @Test(dataProvider = "loadManager")
+    @Test(timeOut = 10000, dataProvider = "loadManager")
     public void testLoadManagerAssignmentForNonPersistentTestAssignment(String loadManagerName) throws Exception {
 
         final String namespace = "my-property/my-ns";
@@ -681,7 +681,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
      * @param loadManagerName
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testNonPersistentTopicUnderPersistentNamespace() throws Exception {
 
         final String namespace = "my-property/my-ns";
@@ -713,7 +713,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
      * @param loadManagerName
      * @throws Exception
      */
-    @Test(dataProvider = "loadManager")
+    @Test(timeOut = 10000, dataProvider = "loadManager")
     public void testNonPersistentBrokerModeRejectPersistentTopic(String loadManagerName) throws Exception {
 
         final String namespace = "my-property/my-ns";
@@ -771,7 +771,7 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMsgDropStat() throws Exception {
 
         int defaultNonPersistentMessageRate = conf.getMaxConcurrentNonPersistentMessagePerConnection();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/PartitionedProducerConsumerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/PartitionedProducerConsumerTest.java
index 9820056..2a1b0ec 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/PartitionedProducerConsumerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/PartitionedProducerConsumerTest.java
@@ -53,7 +53,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
 
     private ExecutorService executor;
 
-    @BeforeClass
+    @BeforeClass(timeOut = 60000 )
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
@@ -62,7 +62,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
         executor = Executors.newFixedThreadPool(1, new DefaultThreadFactory("PartitionedProducerConsumerTest"));
     }
 
-    @AfterClass
+    @AfterClass(timeOut = 60000 )
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -648,7 +648,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testGetPartitionsForTopic() throws Exception {
         int numPartitions = 4;
         String topic = "persistent://my-property/my-ns/my-partitionedtopic1-" + System.currentTimeMillis();
@@ -668,7 +668,7 @@ public class PartitionedProducerConsumerTest extends ProducerConsumerBase {
                 Collections.singletonList(nonPartitionedTopic));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMessageIdForSubscribeToSinglePartition() throws Exception {
         PulsarClient pulsarClient = newPulsarClient(lookupUrl.toString(), 0);// Creates new client connection
         TopicName topicName = null;
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ProducerConsumerBase.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ProducerConsumerBase.java
index c29771d..e669312 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ProducerConsumerBase.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ProducerConsumerBase.java
@@ -32,7 +32,7 @@ import org.testng.annotations.BeforeMethod;
 public abstract class ProducerConsumerBase extends MockedPulsarServiceBaseTest {
     protected String methodName;
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     public void beforeMethod(Method m) throws Exception {
         methodName = m.getName();
     }
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ServiceUrlProviderTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ServiceUrlProviderTest.java
index 01329d8..dfd1633 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ServiceUrlProviderTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/ServiceUrlProviderTest.java
@@ -36,7 +36,7 @@ import lombok.extern.slf4j.Slf4j;
 @Slf4j
 public class ServiceUrlProviderTest extends ProducerConsumerBase {
 
-    @BeforeClass
+    @BeforeClass( timeOut = 60000 )
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
@@ -44,13 +44,13 @@ public class ServiceUrlProviderTest extends ProducerConsumerBase {
 
     }
 
-    @AfterClass
+    @AfterClass( timeOut = 60000 )
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCreateClientWithServiceUrlProvider() throws Exception {
 
         PulsarClient client = PulsarClient.builder()
@@ -84,7 +84,7 @@ public class ServiceUrlProviderTest extends ProducerConsumerBase {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCreateClientWithAutoChangedServiceUrlProvider() throws Exception {
 
         AutoChangedServiceUrlProvider serviceUrlProvider = new AutoChangedServiceUrlProvider(pulsar.getSafeBrokerServiceUrl());
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerStatTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerStatTest.java
index 62b4aec..d5bac99 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerStatTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerStatTest.java
@@ -51,14 +51,14 @@ import com.google.gson.JsonObject;
 public class SimpleProducerConsumerStatTest extends ProducerConsumerBase {
     private static final Logger log = LoggerFactory.getLogger(SimpleProducerConsumerStatTest.class);
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetupForStatsTest();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -74,7 +74,7 @@ public class SimpleProducerConsumerStatTest extends ProducerConsumerBase {
         return new Object[][] { { 0, 0 }, { 0, 2 }, { 1000, 0 }, { 1000, 2 } };
     }
 
-    @Test(dataProvider = "batch_with_timeout")
+    @Test(timeOut = 10000, dataProvider = "batch_with_timeout")
     public void testSyncProducerAndConsumer(int batchMessageDelayMs, int ackTimeoutSec) throws Exception {
         log.info("-- Starting {} test --", methodName);
         ConsumerBuilder<byte[]> consumerBuilder = pulsarClient.newConsumer()
@@ -121,7 +121,7 @@ public class SimpleProducerConsumerStatTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(dataProvider = "batch_with_timeout")
+    @Test(timeOut = 10000, dataProvider = "batch_with_timeout")
     public void testAsyncProducerAndAsyncAck(int batchMessageDelayMs, int ackTimeoutSec) throws Exception {
         log.info("-- Starting {} test --", methodName);
         ConsumerBuilder<byte[]> consumerBuilder = pulsarClient.newConsumer()
@@ -178,7 +178,7 @@ public class SimpleProducerConsumerStatTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(dataProvider = "batch_with_timeout")
+    @Test(timeOut = 10000, dataProvider = "batch_with_timeout")
     public void testAsyncProducerAndReceiveAsyncAndAsyncAck(int batchMessageDelayMs, int ackTimeoutSec)
             throws Exception {
         log.info("-- Starting {} test --", methodName);
@@ -286,7 +286,7 @@ public class SimpleProducerConsumerStatTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testSendTimeout(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -375,7 +375,7 @@ public class SimpleProducerConsumerStatTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAddBrokerLatencyStats() throws Exception {
 
         log.info("-- Starting {} test --", methodName);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java
index 35d4c77..8fb5297 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java
@@ -101,20 +101,20 @@ import org.testng.annotations.Test;
 public class SimpleProducerConsumerTest extends ProducerConsumerBase {
     private static final Logger log = LoggerFactory.getLogger(SimpleProducerConsumerTest.class);
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPublishTimestampBatchDisabled() throws Exception {
 
         log.info("-- Starting {} test --", methodName);
@@ -180,7 +180,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPublishTimestampBatchEnabled() throws Exception {
 
         log.info("-- Starting {} test --", methodName);
@@ -253,7 +253,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         return new Object[][] { { 0 }, { 1000 } };
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testSyncProducerAndConsumer(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -290,7 +290,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testAsyncProducerAndAsyncAck(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
         Consumer<byte[]> consumer = pulsarClient.newConsumer().topic("persistent://my-property/my-ns/my-topic2")
@@ -428,7 +428,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testBackoffAndReconnect(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
         // Create consumer and producer
@@ -481,7 +481,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testSendTimeout(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -519,7 +519,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testInvalidSequence() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -582,7 +582,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSillyUser() {
         try {
             PulsarClient.builder().serviceUrl("invalid://url").build();
@@ -660,7 +660,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
 
     // This is to test that the flow control counter doesn't get corrupted while concurrent receives during
     // reconnections
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testConcurrentConsumerReceiveWhileReconnect(int batchMessageDelayMs) throws Exception {
         final int recvQueueSize = 100;
         final int numConsumersThreads = 10;
@@ -757,7 +757,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         consumer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSendBigMessageSize() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -791,7 +791,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testSendBigMessageSizeButCompressed() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -870,7 +870,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testActiveAndInActiveConsumerEntryCacheBehavior() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -967,7 +967,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testDeactivatingBacklogConsumer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1120,7 +1120,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSendCallBack() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1249,7 +1249,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testConsumerBlockingWithUnAckedMessages() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1328,7 +1328,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testConsumerBlockingWithUnAckedMessagesMultipleIteration() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1403,7 +1403,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
      * @param batchMessageDelayMs
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMutlipleSharedConsumerBlockingWithUnAckedMessages() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1500,7 +1500,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testShouldNotBlockConsumerIfRedeliverBeforeReceive() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1558,7 +1558,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUnackBlockRedeliverMessages() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1625,7 +1625,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         }
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testUnackedBlockAtBatch(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1720,7 +1720,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
      * @param batchMessageDelayMs
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testBlockUnackConsumerAckByDifferentConsumer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1808,7 +1808,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testEnabledChecksumClient() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1853,7 +1853,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testBlockUnackedConsumerRedeliverySpecificMessagesProduceWithPause() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1935,7 +1935,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testBlockUnackedConsumerRedeliverySpecificMessagesCloseConsumerWhileProduce() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -2015,7 +2015,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPriorityConsumer() throws Exception {
         log.info("-- Starting {} test --", methodName);
         Consumer<byte[]> consumer1 = pulsarClient.newConsumer()
@@ -2223,7 +2223,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testRedeliveryFailOverConsumer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -2338,7 +2338,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(groups = "encryption")
+    @Test(timeOut = 10000, groups = "encryption")
     public void testECDSAEncryption() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -2410,7 +2410,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(groups = "encryption")
+    @Test(timeOut = 10000, groups = "encryption")
     public void testRSAEncryption() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -2489,7 +2489,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(groups = "encryption")
+    @Test(timeOut = 20000, groups = "encryption")
     public void testRedeliveryOfFailedMessages() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -2626,7 +2626,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(groups = "encryption")
+    @Test(timeOut = 30000, groups = "encryption")
     public void testEncryptionFailure() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -2753,7 +2753,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(groups = "encryption")
+    @Test(timeOut = 10000, groups = "encryption")
     public void testEncryptionConsumerWithoutCryptoReader() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -2876,7 +2876,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         return new String(data);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testConsumerSubscriptionInitialize() throws Exception {
         log.info("-- Starting {} test --", methodName);
         String topicName = "persistent://my-property/my-ns/test-subscription-initialize-topic";
@@ -2919,7 +2919,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testFlushBatchEnabled() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -2956,7 +2956,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testFlushBatchDisabled() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -2993,7 +2993,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
 
     // Issue 1452: https://github.com/apache/pulsar/issues/1452
     // reachedEndOfTopic should be called only once if a topic has been terminated before subscription
-    @Test
+    @Test(timeOut = 10000)
     public void testReachedEndOfTopic() throws Exception
     {
         String topicName = "persistent://my-property/my-ns/testReachedEndOfTopic";
@@ -3044,7 +3044,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testFailOverConsumerPriority() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -3130,7 +3130,7 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testPartitionedTopicWithOnePartition() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleSchemaTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleSchemaTest.java
index 2e1d5f8..6e31a70 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleSchemaTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleSchemaTest.java
@@ -57,7 +57,7 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
     }
 
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         conf.setSchemaValidationEnforced(schemaValidationEnforced);
@@ -66,13 +66,13 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testString() throws Exception {
         try (Consumer<String> consumer = pulsarClient.newConsumer(Schema.STRING)
                 .topic("persistent://my-property/my-ns/my-topic1")
@@ -116,7 +116,7 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void newProducerNewTopicNewSchema() throws Exception {
         String topic = "my-property/my-ns/schema-test";
         try (Producer<V1Data> p = pulsarClient.newProducer(Schema.AVRO(V1Data.class))
@@ -125,7 +125,7 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void newProducerTopicExistsWithoutSchema() throws Exception {
         String topic = "my-property/my-ns/schema-test";
         try (Producer<byte[]> p = pulsarClient.newProducer().topic(topic).create()) {
@@ -138,7 +138,7 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void newProducerTopicExistsWithSchema() throws Exception {
         String topic = "my-property/my-ns/schema-test";
         try (Producer<V1Data> p = pulsarClient.newProducer(Schema.AVRO(V1Data.class))
@@ -152,7 +152,7 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void newProducerWithoutSchemaOnTopicWithSchema() throws Exception {
         String topic = "my-property/my-ns/schema-test";
 
@@ -185,7 +185,7 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void newConsumerWithSchemaOnNewTopic() throws Exception {
         String topic = "my-property/my-ns/schema-test";
 
@@ -198,7 +198,7 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void newConsumerWithSchemaOnExistingTopicWithoutSchema() throws Exception {
         String topic = "my-property/my-ns/schema-test";
 
@@ -211,7 +211,7 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void newConsumerWithSchemaTopicHasSchema() throws Exception {
         String topic = "my-property/my-ns/schema-test";
 
@@ -224,7 +224,7 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void newBytesConsumerWithTopicWithSchema() throws Exception {
         String topic = "my-property/my-ns/schema-test";
 
@@ -235,12 +235,12 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void getSchemaVersionFromMessagesBatchingDisabled() throws Exception {
         getSchemaVersionFromMessages(false);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void getSchemaVersionFromMessagesBatchingEnabled() throws Exception {
         getSchemaVersionFromMessages(true);
     }
@@ -265,7 +265,7 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
         }
     }
 
-    @Test(dataProvider = "batchingModes")
+    @Test(timeOut = 10000, dataProvider = "batchingModes")
     public void testAutoConsume(boolean batching) throws Exception {
         String topic = "my-property/my-ns/schema-test-auto-consume-" + batching;
 
@@ -294,7 +294,7 @@ public class SimpleSchemaTest extends ProducerConsumerBase {
         }
     }
 
-    @Test(dataProvider = "batchingModes")
+    @Test(timeOut = 10000, dataProvider = "batchingModes")
     public void testAutoKeyValueConsume(boolean batching) throws Exception {
         String topic = "my-property/my-ns/schema-test-auto-keyvalue-consume-" + batching;
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleTypedProducerConsumerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleTypedProducerConsumerTest.java
index 1631850..a85eb4d 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleTypedProducerConsumerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleTypedProducerConsumerTest.java
@@ -56,20 +56,20 @@ import org.testng.annotations.Test;
 public class SimpleTypedProducerConsumerTest extends ProducerConsumerBase {
     private static final Logger log = LoggerFactory.getLogger(SimpleTypedProducerConsumerTest.class);
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testJsonProducerAndConsumer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -114,7 +114,7 @@ public class SimpleTypedProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testJsonProducerAndConsumerWithPrestoredSchema() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -157,7 +157,7 @@ public class SimpleTypedProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testWrongCorruptedSchema() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -184,7 +184,7 @@ public class SimpleTypedProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testProtobufProducerAndConsumer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -233,7 +233,7 @@ public class SimpleTypedProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(expectedExceptions = {PulsarClientException.class})
+    @Test(timeOut = 10000, expectedExceptions = {PulsarClientException.class})
     public void testProtobufConsumerWithWrongPrestoredSchema() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -264,7 +264,7 @@ public class SimpleTypedProducerConsumerTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-   @Test
+   @Test(timeOut = 10000)
    public void testAvroProducerAndConsumer() throws Exception {
        log.info("-- Starting {} test --", methodName);
 
@@ -311,7 +311,7 @@ public class SimpleTypedProducerConsumerTest extends ProducerConsumerBase {
 
    }
 
-    @Test(expectedExceptions = {PulsarClientException.class})
+    @Test(timeOut = 10000, expectedExceptions = {PulsarClientException.class})
     public void testAvroConsumerWithWrongPrestoredSchema() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -434,7 +434,7 @@ public class SimpleTypedProducerConsumerTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAvroProducerAndAutoSchemaConsumer() throws Exception {
        log.info("-- Starting {} test --", methodName);
 
@@ -483,7 +483,7 @@ public class SimpleTypedProducerConsumerTest extends ProducerConsumerBase {
 
    }
 
-   @Test
+   @Test(timeOut = 10000)
     public void testAvroProducerAndAutoSchemaReader() throws Exception {
        log.info("-- Starting {} test --", methodName);
 
@@ -530,7 +530,7 @@ public class SimpleTypedProducerConsumerTest extends ProducerConsumerBase {
 
    }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAutoBytesProducer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -604,7 +604,7 @@ public class SimpleTypedProducerConsumerTest extends ProducerConsumerBase {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMessageBuilderLoadConf() throws Exception {
         String topic = "my-topic-" + System.nanoTime();
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SubscriptionMessageDispatchThrottlingTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SubscriptionMessageDispatchThrottlingTest.java
index cbcef08..e0114ba 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SubscriptionMessageDispatchThrottlingTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/SubscriptionMessageDispatchThrottlingTest.java
@@ -450,7 +450,7 @@ public class SubscriptionMessageDispatchThrottlingTest extends MessageDispatchTh
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testClusterPolicyOverrideConfiguration() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/TlsHostVerification.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/TlsHostVerification.java
index c3409bd..7169e98 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/TlsHostVerification.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/TlsHostVerification.java
@@ -28,7 +28,7 @@ import org.testng.Assert;
 import org.testng.annotations.Test;
 
 public class TlsHostVerification extends TlsProducerConsumerBase {
-    @Test
+    @Test(timeOut = 10000)
     public void testTlsHostVerificationAdminClient() throws Exception {
         Map<String, String> authParams = new HashMap<>();
         authParams.put("tlsCertFile", TLS_CLIENT_CERT_FILE_PATH);
@@ -47,7 +47,7 @@ public class TlsHostVerification extends TlsProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTlsHostVerificationDisabledAdminClient() throws Exception {
         Map<String, String> authParams = new HashMap<>();
         authParams.put("tlsCertFile", TLS_CLIENT_CERT_FILE_PATH);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/TlsProducerConsumerBase.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/TlsProducerConsumerBase.java
index 9a66712..65e9f7e 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/TlsProducerConsumerBase.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/TlsProducerConsumerBase.java
@@ -42,7 +42,7 @@ public class TlsProducerConsumerBase extends ProducerConsumerBase {
     protected final String TLS_SERVER_KEY_FILE_PATH = "./src/test/resources/authentication/tls/broker-key.pem";
     private final String clusterName = "use";
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         // TLS configuration for Broker
@@ -52,7 +52,7 @@ public class TlsProducerConsumerBase extends ProducerConsumerBase {
         super.init();
     }
 
-    @AfterMethod
+    @AfterMethod( timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/TopicReaderTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/TopicReaderTest.java
index 53ff341..56254f3 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/TopicReaderTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/TopicReaderTest.java
@@ -45,14 +45,14 @@ import org.testng.annotations.Test;
 public class TopicReaderTest extends ProducerConsumerBase {
     private static final Logger log = LoggerFactory.getLogger(TopicReaderTest.class);
 
-    @BeforeClass
+    @BeforeClass(timeOut = 60000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterClass
+    @AfterClass(timeOut = 60000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -83,7 +83,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         };
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSimpleReader() throws Exception {
         Reader<byte[]> reader = pulsarClient.newReader().topic("persistent://my-property/my-ns/testSimpleReader")
                 .startMessageId(MessageId.earliest).create();
@@ -111,7 +111,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReaderAfterMessagesWerePublished() throws Exception {
         Producer<byte[]> producer = pulsarClient.newProducer().topic("persistent://my-property/my-ns/testReaderAfterMessagesWerePublished")
                 .create();
@@ -139,7 +139,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMultipleReaders() throws Exception {
         Producer<byte[]> producer = pulsarClient.newProducer().topic("persistent://my-property/my-ns/testMultipleReaders")
                 .create();
@@ -180,7 +180,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testTopicStats() throws Exception {
         String topicName = "persistent://my-property/my-ns/testTopicStats";
 
@@ -201,7 +201,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         assertEquals(stats.subscriptions.size(), 0);
     }
 
-    @Test(dataProvider = "variationsForResetOnLatestMsg")
+    @Test(timeOut = 10000, dataProvider = "variationsForResetOnLatestMsg")
     public void testReaderOnLatestMessage(boolean startInclusive, int numOfMessages) throws Exception {
         final String topicName = "persistent://my-property/my-ns/ReaderOnLatestMessage";
         final int halfOfMsgs = numOfMessages / 2;
@@ -246,7 +246,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReaderOnSpecificMessage() throws Exception {
         Producer<byte[]> producer = pulsarClient.newProducer().topic("persistent://my-property/my-ns/testReaderOnSpecificMessage")
                 .create();
@@ -276,7 +276,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReaderOnSpecificMessageWithBatches() throws Exception {
         Producer<byte[]> producer = pulsarClient.newProducer()
                 .topic("persistent://my-property/my-ns/testReaderOnSpecificMessageWithBatches").enableBatching(true)
@@ -318,7 +318,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test(groups = "encryption")
+    @Test(timeOut = 10000, groups = "encryption")
     public void testECDSAEncryption() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -388,7 +388,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSimpleReaderReachEndOfTopic() throws Exception {
         Reader<byte[]> reader = pulsarClient.newReader().topic("persistent://my-property/my-ns/testSimpleReaderReachEndOfTopic")
                 .startMessageId(MessageId.earliest).create();
@@ -444,7 +444,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReaderReachEndOfTopicOnMessageWithBatches() throws Exception {
         Reader<byte[]> reader = pulsarClient.newReader()
                 .topic("persistent://my-property/my-ns/testReaderReachEndOfTopicOnMessageWithBatches")
@@ -487,7 +487,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testMessageAvailableAfterRestart() throws Exception {
         String topic = "persistent://my-property/use/my-ns/testMessageAvailableAfterRestart";
         String content = "my-message-1";
@@ -523,7 +523,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReaderNonDurableIsAbleToSeekRelativeTime() throws Exception {
         final int numOfMessage = 10;
         final String topicName = "persistent://my-property/my-ns/ReaderNonDurableIsAbleToSeekRelativeTime";
@@ -547,7 +547,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReaderIsAbleToSeekWithTimeOnBeginningOfTopic() throws Exception {
         final String topicName = "persistent://my-property/my-ns/ReaderSeekWithTimeOnBeginningOfTopic";
         final int numOfMessage = 10;
@@ -596,7 +596,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReaderIsAbleToSeekWithMessageIdOnMiddleOfTopic() throws Exception {
         final String topicName = "persistent://my-property/my-ns/ReaderSeekWithMessageIdOnMiddleOfTopic";
         final int numOfMessage = 100;
@@ -651,7 +651,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReaderIsAbleToSeekWithTimeOnMiddleOfTopic() throws Exception {
         final String topicName = "persistent://my-property/my-ns/ReaderIsAbleToSeekWithTimeOnMiddleOfTopic";
         final int numOfMessage = 10;
@@ -684,7 +684,7 @@ public class TopicReaderTest extends ProducerConsumerBase {
         producer.close();
     }
 
-    @Test(dataProvider = "variationsForExpectedPos")
+    @Test(timeOut = 10000, dataProvider = "variationsForExpectedPos")
     public void testReaderStartMessageIdAtExpectedPos(boolean batching, boolean startInclusive, int numOfMessages)
             throws Exception {
         final String topicName = "persistent://my-property/my-ns/ReaderStartMessageIdAtExpectedPos";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/v1/V1_ProducerConsumerBase.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/v1/V1_ProducerConsumerBase.java
index d38da4f..84694f4 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/v1/V1_ProducerConsumerBase.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/v1/V1_ProducerConsumerBase.java
@@ -32,7 +32,7 @@ import org.testng.annotations.BeforeMethod;
 public abstract class V1_ProducerConsumerBase extends MockedPulsarServiceBaseTest {
     protected String methodName;
 
-    @BeforeMethod
+    @BeforeMethod( timeOut = 10000)
     public void beforeMethod(Method m) throws Exception {
         methodName = m.getName();
     }
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/v1/V1_ProducerConsumerTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/v1/V1_ProducerConsumerTest.java
index 24fb5a7..441d8b1 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/api/v1/V1_ProducerConsumerTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/api/v1/V1_ProducerConsumerTest.java
@@ -90,14 +90,14 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
     private static final Logger log = LoggerFactory.getLogger(V1_ProducerConsumerTest.class);
     private static final long BATCHING_MAX_PUBLISH_DELAY_THRESHOLD = 1;
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -108,7 +108,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         return new Object[][] { { 0 }, { 1000 } };
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testSyncProducerAndConsumer(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -149,7 +149,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testAsyncProducerAndAsyncAck(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
         Consumer<byte[]> consumer = pulsarClient.newConsumer()
@@ -243,7 +243,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(dataProvider = "batch")
+    @Test(dataProvider = "batch", timeOut = 100000)
     public void testBackoffAndReconnect(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
         // Create consumer and producer
@@ -293,7 +293,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testSendTimeout(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -334,7 +334,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testInvalidSequence() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -407,7 +407,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSillyUser() throws Exception {
         try {
             PulsarClient.builder().serviceUrl("invalid://url").build();
@@ -492,7 +492,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
 
     // This is to test that the flow control counter doesn't get corrupted while concurrent receives during
     // reconnections
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testConcurrentConsumerReceiveWhileReconnect(int batchMessageDelayMs) throws Exception {
         final int recvQueueSize = 100;
         final int numConsumersThreads = 10;
@@ -599,7 +599,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         executor.shutdownNow();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSendBigMessageSize() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -628,7 +628,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testActiveAndInActiveConsumerEntryCacheBehavior() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -816,7 +816,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSendCallBack() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -948,7 +948,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testConsumerBlockingWithUnAckedMessages() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1031,7 +1031,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testConsumerBlockingWithUnAckedMessagesMultipleIteration() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1107,7 +1107,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testMutlipleSharedConsumerBlockingWithUnAckedMessages() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1211,7 +1211,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testShouldNotBlockConsumerIfRedeliverBeforeReceive() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1271,7 +1271,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testUnackBlockRedeliverMessages() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1342,7 +1342,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         }
     }
 
-    @Test(dataProvider = "batch")
+    @Test(timeOut = 10000, dataProvider = "batch")
     public void testUnackedBlockAtBatch(int batchMessageDelayMs) throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1432,7 +1432,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testBlockUnackConsumerAckByDifferentConsumer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1524,7 +1524,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testEnabledChecksumClient() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1571,7 +1571,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testBlockUnackedConsumerRedeliverySpecificMessagesProduceWithPause() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1657,7 +1657,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testBlockUnackedConsumerRedeliverySpecificMessagesCloseConsumerWhileProduce() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1744,7 +1744,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testPriorityConsumer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1828,7 +1828,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 20000)
     public void testSharedSamePriorityConsumer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -1950,7 +1950,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testRedeliveryFailOverConsumer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -2071,7 +2071,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(groups = "encryption")
+    @Test(timeOut = 10000, groups = "encryption")
     public void testECDSAEncryption() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -2147,7 +2147,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(groups = "encryption")
+    @Test(timeOut = 10000, groups = "encryption")
     public void testRSAEncryption() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
@@ -2232,7 +2232,7 @@ public class V1_ProducerConsumerTest extends V1_ProducerConsumerBase {
         log.info("-- Exiting {} test --", methodName);
     }
 
-    @Test(groups = "encryption")
+    @Test(timeOut = 20000, groups = "encryption")
     public void testEncryptionFailure() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BatchMessageIdImplSerializationTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BatchMessageIdImplSerializationTest.java
index 2d3b5e9..c7843bf 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BatchMessageIdImplSerializationTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BatchMessageIdImplSerializationTest.java
@@ -28,28 +28,28 @@ import org.testng.annotations.Test;
 /**
  */
 
-@Test
+@Test(timeOut = 10000)
 public class BatchMessageIdImplSerializationTest {
-    @Test
+    @Test(timeOut = 10000)
     void testSerialization1() throws Exception {
         BatchMessageIdImpl id = new BatchMessageIdImpl(1, 2, 3, 4);
         byte[] serializedId = id.toByteArray();
         assertEquals(BatchMessageIdImpl.fromByteArray(serializedId), id);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     void testSerialization2() throws Exception {
         BatchMessageIdImpl id = new BatchMessageIdImpl(1, 2, -1, 3);
         byte[] serializedId = id.toByteArray();
         assertEquals(BatchMessageIdImpl.fromByteArray(serializedId), id);
     }
 
-    @Test(expectedExceptions = NullPointerException.class)
+    @Test(timeOut = 10000, expectedExceptions = NullPointerException.class)
     void testSerializationNull() throws Exception {
         BatchMessageIdImpl.fromByteArray(null);
     }
 
-    @Test(expectedExceptions = IOException.class)
+    @Test(timeOut = 10000, expectedExceptions = IOException.class)
     void testSerializationEmpty() throws Exception {
         BatchMessageIdImpl.fromByteArray(new byte[0]);
     }
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BrokerClientIntegrationTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BrokerClientIntegrationTest.java
index 5f09992..ca5e4fe 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BrokerClientIntegrationTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/BrokerClientIntegrationTest.java
@@ -99,14 +99,14 @@ import com.google.common.collect.Sets;
 public class BrokerClientIntegrationTest extends ProducerConsumerBase {
     private static final Logger log = LoggerFactory.getLogger(BrokerClientIntegrationTest.class);
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -132,7 +132,7 @@ public class BrokerClientIntegrationTest extends ProducerConsumerBase {
      * @throws Exception
      */
     @SuppressWarnings({ "rawtypes", "unchecked" })
-    @Test
+    @Test(timeOut = 10000)
     public void testDisconnectClientWithoutClosingConnection() throws Exception {
 
         final String ns1 = "my-property/con-ns1";
@@ -252,7 +252,7 @@ public class BrokerClientIntegrationTest extends ProducerConsumerBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testCloseBrokerService() throws Exception {
 
         final String ns1 = "my-property/brok-ns1";
@@ -676,7 +676,7 @@ public class BrokerClientIntegrationTest extends ProducerConsumerBase {
         pulsarClient.close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testInvalidDynamicConfiguration() throws Exception {
 
         // (1) try to update invalid loadManagerClass name
@@ -732,7 +732,7 @@ public class BrokerClientIntegrationTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCleanProducer() throws Exception {
         log.info("-- Starting {} test --", methodName);
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/CompactedOutBatchMessageTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/CompactedOutBatchMessageTest.java
index f702037..63ffacc 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/CompactedOutBatchMessageTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/CompactedOutBatchMessageTest.java
@@ -34,20 +34,21 @@ import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
 public class CompactedOutBatchMessageTest extends ProducerConsumerBase {
-    @BeforeMethod
+
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testCompactedOutMessages() throws Exception {
         final String topic1 = "persistent://my-property/my-ns/my-topic";
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConnectionPoolTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConnectionPoolTest.java
index 9088e67..93215e7 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConnectionPoolTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConnectionPoolTest.java
@@ -39,19 +39,19 @@ public class ConnectionPoolTest extends MockedPulsarServiceBaseTest {
 
     String serviceUrl = "pulsar://non-existing-dns-name:" + BROKER_PORT;
 
-    @BeforeClass
+    @BeforeClass(timeOut = 60000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
     }
 
-    @AfterClass
+    @AfterClass(timeOut = 60000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSingleIpAddress() throws Exception {
         ClientConfigurationData conf = new ClientConfigurationData();
         EventLoopGroup eventLoop = EventLoopUtil.newEventLoopGroup(1, new DefaultThreadFactory("test"));
@@ -70,7 +70,7 @@ public class ConnectionPoolTest extends MockedPulsarServiceBaseTest {
         client.close();
     }
 
-    @Test
+    @Test(timeOut = 20000)
     public void testDoubleIpAddress() throws Exception {
         String serviceUrl = "pulsar://non-existing-dns-name:" + BROKER_PORT;
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumeBaseExceptionTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumeBaseExceptionTest.java
index 23bf60a..a519346 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumeBaseExceptionTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumeBaseExceptionTest.java
@@ -28,20 +28,20 @@ import org.testng.annotations.Test;
 
 public class ConsumeBaseExceptionTest extends ProducerConsumerBase {
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testClosedConsumer() throws PulsarClientException {
         Consumer<byte[]> consumer = pulsarClient.newConsumer().topic("persistent://my-property/my-ns/topicName")
                 .subscriptionName("my-subscription").subscribe();
@@ -58,7 +58,7 @@ public class ConsumeBaseExceptionTest extends ProducerConsumerBase {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testListener() throws PulsarClientException {
 
         Consumer<byte[]> consumer = pulsarClient.newConsumer().topic("persistent://my-property/my-ns/topicName")
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumerConfigurationTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumerConfigurationTest.java
index 036c45b..03c1296 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumerConfigurationTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumerConfigurationTest.java
@@ -33,7 +33,7 @@ public class ConsumerConfigurationTest extends MockedPulsarServiceBaseTest {
     private static String persistentTopic = "persistent://my-property/use/my-ns/persist";
     private static String nonPersistentTopic = "non-persistent://my-property/use/my-ns/nopersist";
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     public void setup() throws Exception {
         super.internalSetup();
@@ -44,31 +44,31 @@ public class ConsumerConfigurationTest extends MockedPulsarServiceBaseTest {
         admin.namespaces().createNamespace("my-property/use/my-ns");
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReadCompactPersistentExclusive() throws Exception {
         pulsarClient.newConsumer().topic(persistentTopic).subscriptionName("sub1").readCompacted(true)
                 .subscriptionType(SubscriptionType.Exclusive).subscribe().close();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReadCompactPersistentFailover() throws Exception {
         pulsarClient.newConsumer().topic(persistentTopic).subscriptionName("sub1").readCompacted(true)
                 .subscriptionType(SubscriptionType.Failover).subscribe().close();
     }
 
-    @Test(expectedExceptions = InvalidConfigurationException.class)
+    @Test(timeOut = 10000, expectedExceptions = InvalidConfigurationException.class)
     public void testReadCompactPersistentShared() throws Exception {
         pulsarClient.newConsumer().topic(persistentTopic).subscriptionName("sub1").readCompacted(true)
                 .subscriptionType(SubscriptionType.Shared).subscribe().close();
     }
 
-    @Test(expectedExceptions = InvalidConfigurationException.class)
+    @Test(timeOut = 10000, expectedExceptions = InvalidConfigurationException.class)
     public void testReadCompactNonPersistentExclusive() throws Exception {
         pulsarClient.newConsumer().topic(nonPersistentTopic).subscriptionName("sub1").readCompacted(true)
                 .subscriptionType(SubscriptionType.Exclusive).subscribe().close();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumerDedupPermitsUpdate.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumerDedupPermitsUpdate.java
index 1507048..29a7770 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumerDedupPermitsUpdate.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumerDedupPermitsUpdate.java
@@ -37,14 +37,15 @@ import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 
 public class ConsumerDedupPermitsUpdate extends ProducerConsumerBase {
-    @BeforeClass
+
+    @BeforeClass(timeOut = 60000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         producerBaseSetup();
     }
 
-    @AfterClass
+    @AfterClass(timeOut = 60000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumerUnsubscribeTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumerUnsubscribeTest.java
index 9061da0..7d09966 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumerUnsubscribeTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ConsumerUnsubscribeTest.java
@@ -38,19 +38,19 @@ public class ConsumerUnsubscribeTest {
     private static final int BROKER_SERVICE_PORT = PortManager.nextFreePort();
     private static final int BROKER_SERVICE_TLS_PORT = PortManager.nextFreePort();
 
-    @BeforeClass
+    @BeforeClass(timeOut = 60000)
     public void setup() {
         mockBrokerService = new MockBrokerService(WEB_SERVICE_PORT, WEB_SERVICE_TLS_PORT, BROKER_SERVICE_PORT,
                 BROKER_SERVICE_TLS_PORT);
         mockBrokerService.start();
     }
 
-    @AfterClass
+    @AfterClass(timeOut = 60000)
     public void teardown() {
         mockBrokerService.stop();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testConsumerUnsubscribeReference() throws Exception {
         PulsarClientImpl client = (PulsarClientImpl) PulsarClient.builder()
                 .serviceUrl("pulsar://127.0.0.1:" + BROKER_SERVICE_PORT).build();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageIdTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageIdTest.java
index 14349f7..a672782 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageIdTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageIdTest.java
@@ -65,13 +65,13 @@ import org.testng.annotations.Test;
 public class MessageIdTest extends BrokerTestBase {
     private static final Logger log = LoggerFactory.getLogger(MessageIdTest.class);
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     public void setup() throws Exception {
         baseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         internalCleanup();
@@ -281,7 +281,7 @@ public class MessageIdTest extends BrokerTestBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testChecksumVersionComptability() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/topic1";
 
@@ -350,7 +350,7 @@ public class MessageIdTest extends BrokerTestBase {
 
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testChecksumReconnection() throws Exception {
         final String topicName = "persistent://prop/use/ns-abc/topic1";
 
@@ -429,7 +429,7 @@ public class MessageIdTest extends BrokerTestBase {
      *
      * @throws Exception
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testCorruptMessageRemove() throws Exception {
 
         final String topicName = "persistent://prop/use/ns-abc/retry-topic";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageParserTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageParserTest.java
index e00643b..de8ae38 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageParserTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageParserTest.java
@@ -48,7 +48,7 @@ import avro.shaded.com.google.common.collect.Lists;
 
 public class MessageParserTest extends MockedPulsarServiceBaseTest {
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     public void setup() throws Exception {
         super.internalSetup();
@@ -59,13 +59,13 @@ public class MessageParserTest extends MockedPulsarServiceBaseTest {
         admin.namespaces().createNamespace("my-tenant/my-ns", Sets.newHashSet("test"));
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testWithoutBatches() throws Exception {
         String topic = "persistent://my-tenant/my-ns/my-topic";
         TopicName topicName = TopicName.get(topic);
@@ -105,7 +105,7 @@ public class MessageParserTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testWithBatches() throws Exception {
         String topic = "persistent://my-tenant/my-ns/my-topic-with-batch";
         TopicName topicName = TopicName.get(topic);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageRedeliveryTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageRedeliveryTest.java
index 2d31308..65c9608 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageRedeliveryTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/MessageRedeliveryTest.java
@@ -50,14 +50,14 @@ import io.netty.util.concurrent.DefaultThreadFactory;
 public class MessageRedeliveryTest extends ProducerConsumerBase {
     private static final Logger log = LoggerFactory.getLogger(MessageRedeliveryTest.class);
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/NegativeAcksTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/NegativeAcksTest.java
index 857fc20..60b5746 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/NegativeAcksTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/NegativeAcksTest.java
@@ -43,14 +43,14 @@ import org.testng.annotations.Test;
 public class NegativeAcksTest extends ProducerConsumerBase {
 
     @Override
-    @BeforeClass
+    @BeforeClass(timeOut = 60000)
     public void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
     @Override
-    @AfterClass
+    @AfterClass(timeOut = 60000)
     public void cleanup() throws Exception {
         super.internalCleanup();
     }
@@ -97,7 +97,7 @@ public class NegativeAcksTest extends ProducerConsumerBase {
         };
     }
 
-    @Test(dataProvider = "variations")
+    @Test(timeOut = 10000, dataProvider = "variations")
     public void testNegativeAcks(boolean batching, boolean usePartitions, SubscriptionType subscriptionType,
             int negAcksDelayMillis, int ackTimeout)
             throws Exception {
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/PatternTopicsConsumerImplTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/PatternTopicsConsumerImplTest.java
index 1d33641..1d09bb7 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/PatternTopicsConsumerImplTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/PatternTopicsConsumerImplTest.java
@@ -55,7 +55,7 @@ public class PatternTopicsConsumerImplTest extends ProducerConsumerBase {
     private final long ackTimeOutMillis = TimeUnit.SECONDS.toMillis(2);
 
     @Override
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     public void setup() throws Exception {
         // set isTcpLookup = true, to use BinaryProtoLookupService to get topics for a pattern.
         isTcpLookup = true;
@@ -64,7 +64,7 @@ public class PatternTopicsConsumerImplTest extends ProducerConsumerBase {
     }
 
     @Override
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     public void cleanup() throws Exception {
         super.internalCleanup();
     }
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/PerMessageUnAcknowledgedRedeliveryTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/PerMessageUnAcknowledgedRedeliveryTest.java
index 508de46..5ae08fc 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/PerMessageUnAcknowledgedRedeliveryTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/PerMessageUnAcknowledgedRedeliveryTest.java
@@ -42,13 +42,13 @@ public class PerMessageUnAcknowledgedRedeliveryTest extends BrokerTestBase {
     private final long ackTimeOutMillis = TimeUnit.SECONDS.toMillis(2);
 
     @Override
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     public void setup() throws Exception {
         super.internalSetup();
     }
 
     @Override
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     public void cleanup() throws Exception {
         super.internalCleanup();
     }
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawMessageSerDeserTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawMessageSerDeserTest.java
index d634a00..8298db5 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawMessageSerDeserTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawMessageSerDeserTest.java
@@ -33,7 +33,7 @@ import lombok.Cleanup;
 public class RawMessageSerDeserTest {
     static final Logger log = LoggerFactory.getLogger(RawMessageSerDeserTest.class);
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSerializationAndDeserialization() throws Exception {
         int payload = 0xbeefcafe;
         ByteBuf headersAndPayload = Unpooled.buffer(4);
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
index 5085763..d26dba0 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java
@@ -55,7 +55,7 @@ public class RawReaderTest extends MockedPulsarServiceBaseTest {
     private static final int BATCH_MAX_MESSAGES = 10;
     private static final String subscription = "foobar-sub";
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     public void setup() throws Exception {
         super.internalSetup();
@@ -67,7 +67,7 @@ public class RawReaderTest extends MockedPulsarServiceBaseTest {
         admin.namespaces().createNamespace("my-property/my-ns", Sets.newHashSet("test"));
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     public void cleanup() throws Exception {
         super.internalCleanup();
@@ -100,7 +100,7 @@ public class RawReaderTest extends MockedPulsarServiceBaseTest {
         return msgMetadata.getPartitionKey();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testRawReader() throws Exception {
         int numKeys = 10;
 
@@ -122,7 +122,7 @@ public class RawReaderTest extends MockedPulsarServiceBaseTest {
         Assert.assertTrue(keys.isEmpty());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSeekToStart() throws Exception {
         int numKeys = 10;
         String topic = "persistent://my-property/my-ns/my-raw-topic";
@@ -156,7 +156,7 @@ public class RawReaderTest extends MockedPulsarServiceBaseTest {
         Assert.assertTrue(readKeys.isEmpty());
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testSeekToMiddle() throws Exception {
         int numKeys = 10;
         String topic = "persistent://my-property/my-ns/my-raw-topic";
@@ -202,7 +202,7 @@ public class RawReaderTest extends MockedPulsarServiceBaseTest {
     /**
      * Try to fill the receiver queue, and drain it multiple times
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testFlowControl() throws Exception {
         int numMessages = RawReaderImpl.DEFAULT_RECEIVER_QUEUE_SIZE * 5;
         String topic = "persistent://my-property/my-ns/my-raw-topic";
@@ -233,7 +233,7 @@ public class RawReaderTest extends MockedPulsarServiceBaseTest {
         Assert.assertEquals(keys.size(), numMessages);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBatchingExtractKeysAndIds() throws Exception {
         String topic = "persistent://my-property/my-ns/my-raw-topic";
 
@@ -268,7 +268,7 @@ public class RawReaderTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testBatchingRebatch() throws Exception {
         String topic = "persistent://my-property/my-ns/my-raw-topic";
 
@@ -297,7 +297,7 @@ public class RawReaderTest extends MockedPulsarServiceBaseTest {
         }
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testAcknowledgeWithProperties() throws Exception {
         int numKeys = 10;
 
@@ -335,7 +335,7 @@ public class RawReaderTest extends MockedPulsarServiceBaseTest {
                 Long.valueOf(0xdeadbeefdecaL));
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReadCancellationOnClose() throws Exception {
         int numKeys = 10;
 
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ReaderTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ReaderTest.java
index 94bce85..387f2a6 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ReaderTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ReaderTest.java
@@ -41,7 +41,7 @@ public class ReaderTest extends MockedPulsarServiceBaseTest {
 
     private static final String subscription = "reader-sub";
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
@@ -53,7 +53,7 @@ public class ReaderTest extends MockedPulsarServiceBaseTest {
         admin.namespaces().createNamespace("my-property/my-ns", Sets.newHashSet("test"));
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
@@ -84,13 +84,13 @@ public class ReaderTest extends MockedPulsarServiceBaseTest {
         return keys;
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReadMessageWithoutBatching() throws Exception {
         String topic = "persistent://my-property/my-ns/my-reader-topic";
         testReadMessages(topic, false);
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReadMessageWithBatching() throws Exception {
         String topic = "persistent://my-property/my-ns/my-reader-topic-with-batching";
         testReadMessages(topic, true);
@@ -114,7 +114,7 @@ public class ReaderTest extends MockedPulsarServiceBaseTest {
     }
 
 
-    @Test
+    @Test(timeOut = 10000)
     public void testReadFromPartition() throws Exception {
         String topic = "persistent://my-property/my-ns/testReadFromPartition";
         String partition0 = topic + "-partition-0";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/SchemaDeleteTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/SchemaDeleteTest.java
index 24380e1..df9b417 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/SchemaDeleteTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/SchemaDeleteTest.java
@@ -38,7 +38,7 @@ public class SchemaDeleteTest extends MockedPulsarServiceBaseTest {
 
     private static final String subscription = "reader-sub";
 
-    @BeforeMethod
+    @BeforeMethod(timeOut = 10000)
     @Override
     protected void setup() throws Exception {
 
@@ -52,13 +52,13 @@ public class SchemaDeleteTest extends MockedPulsarServiceBaseTest {
         admin.namespaces().createNamespace("my-property/my-ns", Sets.newHashSet("test"));
     }
 
-    @AfterMethod
+    @AfterMethod(timeOut = 10000)
     @Override
     protected void cleanup() throws Exception {
         super.internalCleanup();
     }
 
-    @Test
+    @Test(timeOut = 10000)
     public void createTopicDeleteTopicCreateTopic() throws Exception {
         String namespace = "my-property/my-ns";
         String topic = namespace + "/topic1";
diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/SequenceIdWithErrorTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/SequenceIdWithErrorTest.java
index 895d788..b657e2e 100644
--- a/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/SequenceIdWithErrorTest.java
+++ b/pulsar-broker/src/test/java/org/apache/pulsar/client/impl/SequenceIdWithErrorTest.java
@@ -39,7 +39,7 @@ public class SequenceIdWithErrorTest extends BrokerBkEnsemblesTests {
     /**
      * Test that sequence id from a producer is correct when there are send errors
      */
-    @Test
+    @Test(timeOut = 10000)
     public void testCheckSequenceId() throws Exception {
         admin.namespaces().createNamespace("prop/my-test", Collections.singleton("usc"));
 
@@ -78,12 +78,12 @@ public class SequenceIdWithErrorTest extends BrokerBkEnsemblesTests {
         client.close();
     }
 
-    @Test(enabled = false)
... 1459 lines suppressed ...