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

penghui 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 225baf5  change test case code 
org.apache.pulsar.io.PulsarFunctionE2ETest#testFunctionAutomaticSubCleanup 
(#6758)
225baf5 is described below

commit 225baf5fac4051b04e87bb1d351d85273449b761
Author: luceneReader <[email protected]>
AuthorDate: Tue May 19 21:47:20 2020 +0800

    change test case code 
org.apache.pulsar.io.PulsarFunctionE2ETest#testFunctionAutomaticSubCleanup 
(#6758)
    
    in testcase 
org.apache.pulsar.io.PulsarFunctionE2ETest#testFunctionAutomaticSubCleanup,
    1.  there is one test checkpoint, we should not check 
`admin.functions().getFunction(tenant, namespacePortion, 
functionName).getCleanupSubscription()`,
    we shold check `admin.functions().getFunction(tenant, namespacePortion, 
functionName)` is not null,
    and `admin.functions().getFunction(tenant, namespacePortion, 
functionName).getCleanupSubscription()` should not be null
    
    2. we should not check `Parallelism`, because the code here is 1 instead of 
2
---
 .../java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java     | 1 -
 .../src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java    | 5 +++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
index 8a04adf..1d33194 100644
--- 
a/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
+++ 
b/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/NamespacesBase.java
@@ -2596,7 +2596,6 @@ public abstract class NamespacesBase extends 
AdminResource {
             final String path = path(POLICIES, namespaceName.toString());
             byte[] content = globalZk().getData(path, null, nodeStat);
             Policies policies = jsonMapper().readValue(content, 
Policies.class);
-
             if (offloadPolicies.getManagedLedgerOffloadDeletionLagInMillis() 
== null && OffloadPolicies.DEFAULT_OFFLOAD_DELETION_LAG_IN_MILLIS == null
                     || 
offloadPolicies.getManagedLedgerOffloadDeletionLagInMillis() != null
                     && 
offloadPolicies.getManagedLedgerOffloadDeletionLagInMillis().equals(OffloadPolicies.DEFAULT_OFFLOAD_DELETION_LAG_IN_MILLIS))
 {
diff --git 
a/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java 
b/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java
index c5b605a..58d8ee8 100644
--- 
a/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java
+++ 
b/pulsar-broker/src/test/java/org/apache/pulsar/io/PulsarFunctionE2ETest.java
@@ -1417,7 +1417,8 @@ public class PulsarFunctionE2ETest {
         admin.functions().createFunctionWithUrl(functionConfig, 
jarFilePathUrl);
         retryStrategically((test) -> {
             try {
-                return admin.functions().getFunction(tenant, namespacePortion, 
functionName).getCleanupSubscription();
+                FunctionConfig configure = 
admin.functions().getFunction(tenant, namespacePortion, functionName);
+                return configure != null && configure.getCleanupSubscription() 
!= null;
             } catch (PulsarAdminException e) {
                 return false;
             }
@@ -1510,7 +1511,7 @@ public class PulsarFunctionE2ETest {
         retryStrategically((test) -> {
             try {
                 FunctionConfig result = admin.functions().getFunction(tenant, 
namespacePortion, functionName);
-                return result.getParallelism() == 2 && 
result.getCleanupSubscription() == false;
+                return result.getCleanupSubscription() == false;
             } catch (PulsarAdminException e) {
                 return false;
             }

Reply via email to