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

adutra pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/polaris.git


The following commit(s) were added to refs/heads/main by this push:
     new 0df99b44 Fix testRequestBodyTooLarge and testRequestHeaderTooLarge 
(#736)
0df99b44 is described below

commit 0df99b44b2393cb958d35762c5607fcf4f4648d3
Author: Alexandre Dutra <[email protected]>
AuthorDate: Tue Jan 14 12:01:59 2025 +0100

    Fix testRequestBodyTooLarge and testRequestHeaderTooLarge (#736)
---
 .../service/it/test/PolarisApplicationIntegrationTest.java       | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git 
a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisApplicationIntegrationTest.java
 
b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisApplicationIntegrationTest.java
index f7c10fc2..d6c5c24a 100644
--- 
a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisApplicationIntegrationTest.java
+++ 
b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisApplicationIntegrationTest.java
@@ -26,6 +26,7 @@ import static 
org.testcontainers.shaded.org.awaitility.Awaitility.await;
 
 import com.auth0.jwt.JWT;
 import com.auth0.jwt.algorithms.Algorithm;
+import jakarta.ws.rs.ProcessingException;
 import jakarta.ws.rs.client.Entity;
 import jakarta.ws.rs.client.Invocation;
 import jakarta.ws.rs.core.Response;
@@ -612,6 +613,10 @@ public class PolarisApplicationIntegrationTest {
                 try (Response response = request.post(Entity.json(new 
PrincipalRole("r")))) {
                   assertThat(response.getStatus())
                       
.isEqualTo(Response.Status.REQUEST_HEADER_FIELDS_TOO_LARGE.getStatusCode());
+                } catch (ProcessingException e) {
+                  // In some runtime environments the request above will 
return a 431 but in others
+                  // it'll result in a ProcessingException from the socket 
being closed. The test
+                  // asserts that one of those things happens.
                 }
               });
     }
@@ -642,6 +647,10 @@ public class PolarisApplicationIntegrationTest {
                   // provided most of the time.
                   assertThat(response.getStatus())
                       
.isEqualTo(Response.Status.REQUEST_ENTITY_TOO_LARGE.getStatusCode());
+                } catch (ProcessingException e) {
+                  // In some runtime environments the request above will 
return a 431 but in others
+                  // it'll result in a ProcessingException from the socket 
being closed. The test
+                  // asserts that one of those things happens.
                 }
               });
     }

Reply via email to