poorbarcode commented on code in PR #19383:
URL: https://github.com/apache/pulsar/pull/19383#discussion_r1093442014


##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/admin/AdminApiOffloadTest.java:
##########
@@ -290,6 +293,21 @@ public void testSetNamespaceOffloadPolicies() throws 
Exception {
         assertEquals(admin.namespaces().getOffloadPolicies(myNamespace), 
policies);
     }
 
+    @Test
+    public void testSetNamespaceOffloadPoliciesFailByReadOnly() throws 
Exception {
+        
pulsar.getConfigurationMetadataStore().put(NamespaceResources.POLICIES_READONLY_FLAG_PATH,
 "0".getBytes(),
+                Optional.empty()).join();
+        try {
+            admin.namespaces().setOffloadThresholdInSeconds(myNamespace, 300);
+            fail("set offload threshold should fail when ns policies is 
readonly");
+        } catch (Exception ex){
+            // ignore.
+        }
+        // cleanup.
+        
pulsar.getConfigurationMetadataStore().delete(NamespaceResources.POLICIES_READONLY_FLAG_PATH,

Review Comment:
   Already fixed. Thanks



-- 
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: [email protected]

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

Reply via email to