Skip to content

Commit

Permalink
Use port 8001 instead to avoid conflict in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Chia committed Aug 1, 2023
1 parent a059a82 commit 11a84d3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion tests/integration/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ services:
context: .
dockerfile: Dockerfile.s3_retry_server
ports:
- 8000:8000
- 8001:8000
6 changes: 6 additions & 0 deletions tests/integration/io/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
###
Expand Down
12 changes: 4 additions & 8 deletions tests/integration/io/parquet/test_reads_local_fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import pytest

from daft.io import IOConfig, S3Config
from daft.table import Table

BUCKETS = ["head-retries-bucket", "get-retries-bucket"]
Expand All @@ -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()
Expand All @@ -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)

0 comments on commit 11a84d3

Please sign in to comment.