-
Notifications
You must be signed in to change notification settings - Fork 215
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
Fix image proxy get error handling #3455
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,31 +32,28 @@ def test_health_check_calls__check_db(api_client): | |
|
||
|
||
def test_health_check_es_timed_out(api_client): | ||
mock_health_response(timed_out=True) | ||
pook.on() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This and the other changes in this test module are cleanup. Using |
||
res = api_client.get("/healthcheck/", data={"check_es": True}) | ||
pook.off() | ||
with pook.use(): | ||
mock_health_response(timed_out=True) | ||
res = api_client.get("/healthcheck/", data={"check_es": True}) | ||
|
||
assert res.status_code == 503 | ||
assert res.json()["detail"] == "es_timed_out" | ||
|
||
|
||
@pytest.mark.parametrize("status", ("yellow", "red")) | ||
def test_health_check_es_status_bad(status, api_client): | ||
mock_health_response(status=status) | ||
pook.on() | ||
res = api_client.get("/healthcheck/", data={"check_es": True}) | ||
pook.off() | ||
with pook.use(): | ||
mock_health_response(status=status) | ||
res = api_client.get("/healthcheck/", data={"check_es": True}) | ||
|
||
assert res.status_code == 503 | ||
assert res.json()["detail"] == f"es_status_{status}" | ||
|
||
|
||
@pytest.mark.django_db | ||
def test_health_check_es_all_good(api_client): | ||
mock_health_response(status="green") | ||
pook.on() | ||
res = api_client.get("/healthcheck/", data={"check_es": True}) | ||
pook.off() | ||
with pook.use(): | ||
mock_health_response(status="green") | ||
res = api_client.get("/healthcheck/", data={"check_es": True}) | ||
|
||
assert res.status_code == 200 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ x-airflow-common: &airflow-common | |
- CATALOG_PY_VERSION | ||
- CATALOG_AIRFLOW_VERSION | ||
volumes: | ||
- ./catalog:/opt/airflow/catalog | ||
- ./catalog:/opt/airflow/catalog:z | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes are for #3276 |
||
- catalog-cache:/home/airflow/.cache | ||
|
||
services: | ||
|
@@ -55,7 +55,7 @@ services: | |
- "50255:5432" | ||
volumes: | ||
- catalog-postgres:/var/lib/postgresql/data | ||
- ./sample_data:/sample_data | ||
- ./sample_data:/sample_data:z | ||
env_file: | ||
- docker/upstream_db/env.docker | ||
healthcheck: | ||
|
@@ -76,7 +76,7 @@ services: | |
command: minio server /data --address :5000 --console-address :5001 | ||
volumes: | ||
- minio:/data | ||
- ./docker/minio/s3_entrypoint.sh:/opt/minio/s3_entrypoint.sh:ro | ||
- ./docker/minio/s3_entrypoint.sh:/opt/minio/s3_entrypoint.sh:ro,z | ||
entrypoint: /opt/minio/s3_entrypoint.sh | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:5010/minio/health/live"] | ||
|
@@ -97,8 +97,8 @@ services: | |
volumes: | ||
# Buckets for testing provider data imported from s3 are subdirectories under | ||
# /tests/s3-data/ | ||
- ./catalog/tests/s3-data:/data:rw | ||
- ./docker/minio/load_to_s3_entrypoint.sh:/opt/minio/load_to_s3_entrypoint.sh:ro | ||
- ./catalog/tests/s3-data:/data:rw,z | ||
- ./docker/minio/load_to_s3_entrypoint.sh:/opt/minio/load_to_s3_entrypoint.sh:ro,z | ||
entrypoint: /opt/minio/load_to_s3_entrypoint.sh | ||
|
||
# Dev changes for the scheduler | ||
|
@@ -161,8 +161,8 @@ services: | |
image: docker.io/clickhouse/clickhouse-server:23.4-alpine | ||
volumes: | ||
- plausible-clickhouse:/var/lib/clickhouse | ||
- ./docker/clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro | ||
- ./docker/clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro | ||
- ./docker/clickhouse/clickhouse-config.xml:/etc/clickhouse-server/config.d/logging.xml:ro,z | ||
- ./docker/clickhouse/clickhouse-user-config.xml:/etc/clickhouse-server/users.d/logging.xml:ro,z | ||
ulimits: | ||
nofile: | ||
soft: 262144 | ||
|
@@ -224,7 +224,7 @@ services: | |
- API_PY_VERSION | ||
image: openverse-api | ||
volumes: | ||
- ./api:/api | ||
- ./api:/api:z | ||
ports: | ||
- "50280:8000" # Django | ||
depends_on: | ||
|
@@ -255,7 +255,7 @@ services: | |
- es | ||
- indexer_worker | ||
volumes: | ||
- ./ingestion_server:/ingestion_server | ||
- ./ingestion_server:/ingestion_server:z | ||
env_file: | ||
- ingestion_server/env.docker | ||
- ingestion_server/.env | ||
|
@@ -280,7 +280,7 @@ services: | |
- upstream_db | ||
- es | ||
volumes: | ||
- ./ingestion_server:/ingestion_server | ||
- ./ingestion_server:/ingestion_server:z | ||
env_file: | ||
- ingestion_server/env.docker | ||
stdin_open: true | ||
|
@@ -314,8 +314,8 @@ services: | |
depends_on: | ||
- web | ||
volumes: | ||
- ./docker/nginx/templates:/etc/nginx/templates | ||
- ./docker/nginx/certs:/etc/nginx/certs | ||
- ./docker/nginx/templates:/etc/nginx/templates:z | ||
- ./docker/nginx/certs:/etc/nginx/certs:z | ||
|
||
frontend_nginx: | ||
profiles: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The response text is ambiguous from aiohttp (I wasn't entirely sure what it was and whether it matched wherever requests as using). I removed it because I figure we really care more about the status code, and if we need specific details about the error itself, we can look at the logs for the exc.message or review the captured exception in sentry (if relevant).