BewareMyPower commented on code in PR #25707:
URL: https://github.com/apache/pulsar/pull/25707#discussion_r3199448134
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/TopicPolicyTestUtils.java:
##########
@@ -72,6 +72,13 @@ public static TopicPolicies
getGlobalTopicPolicies(TopicPoliciesService topicPol
public static Optional<TopicPolicies>
getTopicPoliciesBypassCache(TopicPoliciesService topicPoliciesService,
TopicName topicName, boolean isGlobal)
throws Exception {
+ if (topicPoliciesService instanceof LegacyAwareTopicPoliciesService
legacyService) {
+ TopicPoliciesService resolved =
legacyService.resolveService(topicName.getNamespaceObject()).get();
+ return getTopicPoliciesBypassCache(resolved, topicName, isGlobal);
+ }
+ if (topicPoliciesService instanceof MetadataStoreTopicPoliciesService
metadataStoreService) {
+ return
metadataStoreService.getTopicPoliciesDirectFromStore(topicName, isGlobal).get();
+ }
Review Comment:
The test should be responsible to set a timeout when calling
`getTopicPoliciesBypassCache`,
--
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]