diff --git a/tests/integration/docker-compose/docker-compose.yml b/tests/integration/docker-compose/docker-compose.yml index 9da118cb58..6b9f6632c4 100644 --- a/tests/integration/docker-compose/docker-compose.yml +++ b/tests/integration/docker-compose/docker-compose.yml @@ -34,4 +34,4 @@ services: context: . dockerfile: Dockerfile.s3_retry_server ports: - - 8000:8000 + - 8001:8000 diff --git a/tests/integration/io/conftest.py b/tests/integration/io/conftest.py index f3ed954b52..1819202edd 100644 --- a/tests/integration/io/conftest.py +++ b/tests/integration/io/conftest.py @@ -54,6 +54,12 @@ def nginx_config() -> tuple[str, pathlib.Path]: ) +@pytest.fixture(scope="session") +def retry_server_s3_config() -> daft.io.IOConfig: + """Returns the URL to the local retry_server fixture""" + return daft.io.IOConfig(s3=daft.io.S3Config(endpoint_url="http://127.0.0.1:8001")) + + ### # Mounting utilities: mount data and perform cleanup at the end of each test ### diff --git a/tests/integration/io/parquet/test_reads_local_fixtures.py b/tests/integration/io/parquet/test_reads_local_fixtures.py index 9a084c4992..5754a563d6 100644 --- a/tests/integration/io/parquet/test_reads_local_fixtures.py +++ b/tests/integration/io/parquet/test_reads_local_fixtures.py @@ -4,7 +4,6 @@ import pytest -from daft.io import IOConfig, S3Config from daft.table import Table BUCKETS = ["head-retries-bucket", "get-retries-bucket"] @@ -13,12 +12,11 @@ @pytest.mark.integration() @pytest.mark.parametrize("status_code", [400, 403, 404]) @pytest.mark.parametrize("bucket", BUCKETS) -def test_non_retryable_errors(status_code: int, bucket: str): - io_config = IOConfig(s3=S3Config(endpoint_url="http://127.0.0.1:8000")) +def test_non_retryable_errors(retry_server_s3_config, status_code: int, bucket: str): data_path = f"s3://{bucket}/{status_code}/1/{uuid.uuid4()}" with pytest.raises(ValueError): - Table.read_parquet(data_path, io_config=io_config) + Table.read_parquet(data_path, io_config=retry_server_s3_config) @pytest.mark.integration() @@ -41,11 +39,9 @@ def test_non_retryable_errors(status_code: int, bucket: str): ], ) @pytest.mark.parametrize("bucket", BUCKETS) -def test_retryable_errors(status_code: int, bucket: str): - io_config = IOConfig(s3=S3Config(endpoint_url="http://127.0.0.1:8000")) - +def test_retryable_errors(retry_server_s3_config, status_code: int, bucket: str): # By default the SDK retries 3 times, so we should be able to tolerate NUM_ERRORS=2 NUM_ERRORS = 2 data_path = f"s3://{bucket}/{status_code}/{NUM_ERRORS}/{uuid.uuid4()}" - Table.read_parquet(data_path, io_config=io_config) + Table.read_parquet(data_path, io_config=retry_server_s3_config)