fix: 출시 전 QA 버그 3건 — 주말 플랜 500, 광주·전남 행사 0건, 미세먼지 갱신 멈춤

- 주말 플랜: '14시~' 같은 시간 라벨에서 정렬이 멈춰 피드 전체가 500 (광산구·울릉군)
- 광주·전남: 구 코드는 12인데 행사는 29·46으로 저장돼 27개 구에서 행사를 못 찾음
- 미세먼지: 에어코리아 전국 조회가 15~20초 걸려 8초 한도에 매번 걸림 → 45초
This commit is contained in:
minaChoi committed 2026-10-08 13:58:06 +09:00
1 parent 5734b57758
commit 1fa0695c84
7 files changed
+60 -12

No files matched your search

+15 -1
View File
@@ -5,7 +5,8 @@ import httpx
import pytest
from config.settings import settings
from services.external import data_go_kr, guard, open_meteo
from services.external import airkorea, data_go_kr, guard, open_meteo
from services.external.airkorea import fetch_realtime
from services.external.data_go_kr import DataGoKrRequestFailed, get_body
from services.external.open_meteo import OpenMeteoRequestFailed, fetch_clouds
@@ -93,3 +94,16 @@ async def test_open_meteo_down_is_skipped(monkeypatch):
with pytest.raises(OpenMeteoRequestFailed):
await fetch_clouds(client, [(37.5, 127.0)])
assert len(calls) == 1
@pytest.mark.anyio
async def test_airkorea_nationwide_call_waits_past_default_budget(fast, monkeypatch):
"""전국 미세먼지 조회는 15~20초 걸려 기본 한도로는 늘 실패한다."""
monkeypatch.setattr(airkorea, "BUDGET_SEC", 2.0)
async def slow(req: httpx.Request) -> httpx.Response:
await asyncio.sleep(0.5)
return httpx.Response(200, json={"response": {"header": {"resultCode": "00"}, "body": {"items": [{"stationName": "x"}], "totalCount": 1}}})
async with _client(slow) as client:
assert await fetch_realtime(client) == [{"stationName": "x"}]