You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "JooHyukKim (via GitHub)" <gi...@apache.org> on 2023/06/24 02:35:31 UTC

[GitHub] [pulsar] JooHyukKim commented on a diff in pull request #20555: [fix][test] Flakey-test : Remove `null` assignment to Pulsar insntance in `MockedPulsarServiceBaseTest`

JooHyukKim commented on code in PR #20555:
URL: https://github.com/apache/pulsar/pull/20555#discussion_r1240576317


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java:
##########
@@ -139,22 +139,24 @@ protected void setup() throws Exception {
 
     @AfterMethod(alwaysRun = true)
     public void rest() throws Exception {
-        pulsar.getConfiguration().setForceDeleteTenantAllowed(true);
-        pulsar.getConfiguration().setForceDeleteNamespaceAllowed(true);
+        if (pulsar != null) {

Review Comment:
   ### Explanation
   
   Current version is second approach, `null`-checking where the original issue #20553 arises. This will just work because if Pulsar is `null`, it means that all resources are closed and 
   
   [First approach (đź”—commit)](https://github.com/apache/pulsar/pull/20555/commits/ea15855511c1fd371a8d46eb8288ff26e62d17db) was removing `null` assignment nullifying Pulsar instance in base `MockedPulsarServiceBaseTest`, but later on this first approach turns out to be unncessary because Pulsar instance appropriately invokes `pulsar.close()` before `null`-assignment.



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