From 45181b53994efa0948262a2ff8874be4aa05f280 Mon Sep 17 00:00:00 2001 From: fengyubiao Date: Fri, 12 Aug 2022 20:05:23 +0800 Subject: [PATCH] [fix][flaky-test]AdminApi2Test.testDeleteTenant (#17070) --- .../apache/pulsar/broker/admin/AdminApi2Test.java | 13 +++++++++++++ .../apache/pulsar/broker/admin/AdminApiTest.java | 1 + 2 files changed, 14 insertions(+) diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java index 410ad097f6a3e4..b3072a693ee81c 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApi2Test.java @@ -1336,6 +1336,13 @@ public void testPreciseBacklog() throws PulsarClientException, PulsarAdminExcept @Test public void testDeleteTenant() throws Exception { + // Disabled conf: systemTopicEnabled. see: https://github.com/apache/pulsar/pull/17070 + boolean originalSystemTopicEnabled = conf.isSystemTopicEnabled(); + if (originalSystemTopicEnabled) { + internalCleanup(); + conf.setSystemTopicEnabled(false); + setup(); + } pulsar.getConfiguration().setForceDeleteNamespaceAllowed(false); String tenant = "test-tenant-1"; @@ -1384,6 +1391,12 @@ public void testDeleteTenant() throws Exception { assertFalse(pulsar.getLocalMetadataStore().exists(partitionedTopicPath).join()); assertFalse(pulsar.getLocalMetadataStore().exists(localPoliciesPath).join()); assertFalse(pulsar.getLocalMetadataStore().exists(bundleDataPath).join()); + // Reset conf: systemTopicEnabled + if (originalSystemTopicEnabled) { + internalCleanup(); + conf.setSystemTopicEnabled(true); + setup(); + } } @Test 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 ece5f8d8302131..329f4ba4cdebd6 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 @@ -2919,6 +2919,7 @@ public MockedPulsarService(ServiceConfiguration conf) { @Override protected void setup() throws Exception { super.conf.setLoadManagerClassName(conf.getLoadManagerClassName()); + super.conf.setSystemTopicEnabled(conf.isSystemTopicEnabled()); super.internalSetup(); }