Skip to content

Commit

Permalink
debug testRequestBodyTooLarge
Browse files Browse the repository at this point in the history
  • Loading branch information
adutra committed Nov 25, 2024
1 parent 52529af commit adfbbc2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
validate-wrappers: false

- name: Check formatting
run: ./gradlew check
run: ./gradlew :polaris-service:test --tests org.apache.polaris.service.PolarisApplicationIntegrationTest

- name: Check Maven publication
run: ./gradlew publishToMavenLocal sourceTarball
Expand Down
3 changes: 3 additions & 0 deletions polaris-service/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* under the License.
*/

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask

plugins {
Expand Down Expand Up @@ -229,6 +230,8 @@ tasks.named<Test>("test").configure {
jvmArgs("--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED")
useJUnitPlatform()
maxParallelForks = 4
testLogging.showStandardStreams = true
testLogging.exceptionFormat = TestExceptionFormat.FULL
}

/**
Expand Down
3 changes: 3 additions & 0 deletions polaris-service/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ polaris.storage.gcp.lifespan=PT1H
%test.quarkus.log.category."org.apache.iceberg.rest.RESTSessionCatalog".level=ERROR
%test.quarkus.log.category."org.apache.polaris.core.persistence.PolarisMetaStoreManagerImpl".level=ERROR
%test.quarkus.log.category."org.apache.polaris.service.context.DefaultRealmContextResolver".level=ERROR
%test.quarkus.log.category."org.apache.polaris.service.catalog.PolarisCatalogHandlerWrapper".level=ERROR
%test.quarkus.log.category."org.apache.polaris.service.storage.PolarisStorageIntegrationProviderImpl".level=ERROR
%test.quarkus.log.category."org.jboss.resteasy".level=DEBUG
%test.quarkus.otel.enabled=false
%test.quarkus.http.limits.max-body-size=1000000
%test.polaris.context.default-realm=POLARIS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,6 @@ public void testRequestBodyTooLarge() {
.header("Authorization", "Bearer " + testHelper.adminToken)
.header(REALM_PROPERTY_KEY, testHelper.realm)
.post(largeRequest)) {
LOGGER.error("testRequestBodyTooLarge={}", response.getStatus());
assertThat(response)
.returns(Response.Status.REQUEST_ENTITY_TOO_LARGE.getStatusCode(), Response::getStatus);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static RESTCatalog createSnowmanManagedCatalog(
PolarisIntegrationTestHelper helper, Catalog catalog, Map<String, String> extraProperties) {
return createSnowmanManagedCatalog(
helper,
String.format("http://localhost:%d", helper.getLocalPort()),
String.format("http://localhost:%d", helper.localPort),
helper.realm,
catalog,
extraProperties);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,15 @@
import org.apache.polaris.core.persistence.PolarisMetaStoreManager;
import org.apache.polaris.core.persistence.PolarisMetaStoreSession;
import org.apache.polaris.core.storage.aws.PolarisS3FileIOClientFactory;
import org.apache.polaris.service.PolarisApplicationIntegrationTest;
import org.apache.polaris.service.auth.TokenUtils;
import org.apache.polaris.service.catalog.io.DefaultFileIOFactory;
import org.apache.polaris.service.catalog.io.FileIOFactory;
import org.apache.polaris.service.context.RealmContextResolver;
import org.apache.polaris.service.persistence.InMemoryPolarisMetaStoreManagerFactory;
import org.junit.jupiter.api.TestInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@Singleton
public class PolarisIntegrationTestHelper {
Expand Down Expand Up @@ -112,14 +115,6 @@ public void setUp(TestInfo testInfo) {
realm);
}

public int getLocalPort() {
return localPort;
}

public int getLocalManagementPort() {
return localManagementPort;
}

private void fetchAdminSecrets() {
if (!(metaStoreManagerFactory instanceof InMemoryPolarisMetaStoreManagerFactory)) {
metaStoreManagerFactory.bootstrapRealms(List.of(realm));
Expand Down Expand Up @@ -231,13 +226,17 @@ private void createSnowmanCredentials() {
}
}

private static final Logger LOGGER =
LoggerFactory.getLogger(PolarisIntegrationTestHelper.class);

public void tearDown() {
try {
if (realm != null) {
metaStoreManagerFactory.purgeRealms(List.of(realm));
}
} finally {
if (client != null) {
LOGGER.warn("Closing client");
client.close();
}
}
Expand Down

0 comments on commit adfbbc2

Please sign in to comment.