Skip to content

fix(testing): Do not let PolarisOverlappingTableTest spam /tmp #1641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import static org.assertj.core.api.Assertions.assertThat;

import jakarta.ws.rs.core.Response;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import java.util.UUID;
Expand All @@ -39,6 +40,7 @@
import org.apache.polaris.core.admin.model.StorageConfigInfo;
import org.apache.polaris.service.TestServices;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.io.TempDir;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
Expand All @@ -47,7 +49,6 @@ public class PolarisOverlappingTableTest {

private static final String namespace = "ns";
private static final String catalog = "test-catalog";
private static final String baseLocation = "file:///tmp/PolarisOverlappingTableTest";

private int createTable(TestServices services, String location) {
CreateTableRequest createTableRequest =
Expand Down Expand Up @@ -120,9 +121,15 @@ static Stream<Arguments> testTableLocationRestrictions() {
void testTableLocationRestrictions(
Map<String, Object> serverConfig,
Map<String, String> catalogConfig,
int expectedStatusForOverlaps) {
int expectedStatusForOverlaps,
@TempDir Path tempDir) {
TestServices services = TestServices.builder().config(serverConfig).build();

String baseLocation = tempDir.toAbsolutePath().toUri().toString();
if (baseLocation.endsWith("/")) {
baseLocation = baseLocation.substring(0, baseLocation.length() - 1);
}

CatalogProperties.Builder propertiesBuilder =
CatalogProperties.builder()
.setDefaultBaseLocation(String.format("%s/%s", baseLocation, catalog))
Expand Down
Loading