sijie commented on a change in pull request #9043:
URL: https://github.com/apache/pulsar/pull/9043#discussion_r553806131



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/DemoPollutedEnvTest.java
##########
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.broker.service;
+
+import org.apache.pulsar.client.api.Consumer;
+import org.apache.pulsar.client.api.Schema;
+import static org.testng.Assert.fail;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * This demo shows that the test is executed twice, but the environment
+ * in the second execution is not a fresh new env,
+ * in fact the consumer is not able to subscribe.
+ * 
+ * org.apache.pulsar.client.api.PulsarClientException$ConsumerBusyException: 
Exclusive consumer is already connected

Review comment:
       If we use `BeforeClass`, why not take a different approach to fix the 
tests to make it be able to run multiple tests? In this way, you can also help 
improve the project. 

##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/DemoPollutedEnvTest.java
##########
@@ -0,0 +1,65 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pulsar.broker.service;
+
+import org.apache.pulsar.client.api.Consumer;
+import org.apache.pulsar.client.api.Schema;
+import static org.testng.Assert.fail;
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+/**
+ * This demo shows that the test is executed twice, but the environment
+ * in the second execution is not a fresh new env,
+ * in fact the consumer is not able to subscribe.
+ * 
+ * org.apache.pulsar.client.api.PulsarClientException$ConsumerBusyException: 
Exclusive consumer is already connected

Review comment:
       If `testRetryCount == 1` is a problem, you can find those tests impacted 
by this and fix those tests. 
   
   I am just not convinced by `testRetryCount == 0` will help us get into a 
better situation. 




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to