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

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


The following commit(s) were added to refs/heads/master by this push:
     new a9048639c1c [fix] Test was leaving client instance to null (#22631)
a9048639c1c is described below

commit a9048639c1c9b60b67fc96e4a40d168bcf86c0b4
Author: Matteo Merli <mme...@apache.org>
AuthorDate: Wed May 1 11:15:43 2024 -0700

    [fix] Test was leaving client instance to null (#22631)
---
 .../org/apache/pulsar/client/api/SimpleProducerConsumerTest.java    | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

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 691f501777e..70214fe6e3b 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
@@ -4329,10 +4329,6 @@ public class SimpleProducerConsumerTest extends 
ProducerConsumerBase {
     public void testAccessAvroSchemaMetadata(Schema<MyBean> schema) throws 
Exception {
         log.info("-- Starting {} test --", methodName);
 
-        if (pulsarClient == null) {
-            pulsarClient = newPulsarClient(lookupUrl.toString(), 0);
-        }
-
         final String topic = "persistent://my-property/my-ns/accessSchema";
         Consumer<GenericRecord> consumer = 
pulsarClient.newConsumer(Schema.AUTO_CONSUME())
                 .topic(topic)
@@ -4382,7 +4378,7 @@ public class SimpleProducerConsumerTest extends 
ProducerConsumerBase {
             fail();
         } finally {
             pulsarClient.shutdown();
-            pulsarClient = null;
+            pulsarClient = newPulsarClient(lookupUrl.toString(), 0);
             admin.schemas().deleteSchema(topic);
         }
     }

Reply via email to