You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/10/14 09:01:10 UTC

[GitHub] [pulsar] ethqunzhong commented on a diff in pull request #17887: [improve][test] Improve SimpleProducerConsumerTest to reduce the execution time

ethqunzhong commented on code in PR #17887:
URL: https://github.com/apache/pulsar/pull/17887#discussion_r995526974


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java:
##########
@@ -125,13 +126,35 @@ public class SimpleProducerConsumerTest extends ProducerConsumerBase {
     private static final int RECEIVE_TIMEOUT_SHORT_MILLIS = 200 * TIMEOUT_MULTIPLIER;
     private static final int RECEIVE_TIMEOUT_MEDIUM_MILLIS = 1000 * TIMEOUT_MULTIPLIER;
 
-    @BeforeMethod(alwaysRun = true)
+    @BeforeClass
     @Override
     protected void setup() throws Exception {
         super.internalSetup();
         super.producerBaseSetup();
     }
 
+    @AfterMethod(alwaysRun = true)
+    public void rest() throws Exception {
+        pulsar.getConfiguration().setForceDeleteTenantAllowed(true);
+        pulsar.getConfiguration().setForceDeleteNamespaceAllowed(true);
+
+        for (String tenant : admin.tenants().getTenants()) {
+            for (String namespace : admin.namespaces().getNamespaces(tenant)) {
+                admin.namespaces().deleteNamespace(namespace, true);

Review Comment:
   > Suggest to use `deleteNamespaceGraceFully`, because `delete namespace` is not a stable cmd, see #17157.
   > 
   > Note that `deleteNamespaceGraceFully` runs slower than `delete namespace` and is unsuitable for all scenarios.
   
   in my CI test, There are two failures related to these changes:
   Time elapsed failures while excute `deleteNamespaceGraceFully `
   see the checks in https://github.com/apache/pulsar/actions/runs/3242148385/jobs/5326408439
   could i skip this test temporary?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org