andrew4699 commented on code in PR #278:
URL: https://github.com/apache/polaris/pull/278#discussion_r1761719017


##########
polaris-service/src/test/java/org/apache/polaris/service/ratelimiter/AsyncFallbackTest.java:
##########
@@ -0,0 +1,75 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.polaris.service.ratelimiter;
+
+import io.dropwizard.testing.ConfigOverride;
+import io.dropwizard.testing.ResourceHelpers;
+import io.dropwizard.testing.junit5.DropwizardAppExtension;
+import io.dropwizard.testing.junit5.DropwizardExtensionsSupport;
+import jakarta.ws.rs.core.Response;
+import java.util.function.Consumer;
+import org.apache.polaris.service.PolarisApplication;
+import org.apache.polaris.service.PolarisApplicationIntegrationTest;
+import org.apache.polaris.service.config.PolarisApplicationConfig;
+import org.apache.polaris.service.test.PolarisConnectionExtension;
+import org.apache.polaris.service.test.SnowmanCredentialsExtension;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.extension.ExtendWith;
+
+/**
+ * Integration test that verifies the timeout behavior for fetching async rate 
limiters. This is in
+ * its own test class because the Dropwizard app is per test class and there 
isn't a great way to
+ * allow tests to clear the rate limiter cache.
+ */
+@ExtendWith({
+  DropwizardExtensionsSupport.class,
+  PolarisConnectionExtension.class,
+  SnowmanCredentialsExtension.class
+})
+public class AsyncFallbackTest {

Review Comment:
   This test is a failure scenario where the async construction times out.
   
   I made construction async to be able to explicitly set a timeout and 
hopefully _prevent_ people from accidentally making their construction blocking 
(i.e. if they need to fetch account information). I'm happy to change it to be 
synchronous and leave it for a future PR. I'm also happy to accept suggestions 
on how the async implementation can be improved as this is my first time 
touching async functionality in Java.



-- 
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-unsubscr...@polaris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to