test: 업로드 E2E 플레이크 해소 (대기 10초 -> 30초 상수)

test_browser_uploads_image_and_selects_new_submission 이 전체 스위트에서만
실패하고 단독 실행에서는 통과했다. 업로드는 케이스가 큐에 나타나기 전에
서버에서 실분석(디코드/지문/YuNet)을 돌리므로, 다른 스펙과 CPU 를 다투는
전체 실행에서 10초를 넘겼다.

UPLOAD_ANALYSIS_TIMEOUT_MS(30초)로 올리고 이유를 상수 옆에 남겼다. 모킹된
부트스트랩 대기와 달리 이 경로만 여유가 필요하다는 점이 코드에서 보이게 했다.
upload_and_open 의 기본값도 같은 상수를 쓴다.
This commit is contained in:
changukyu 2026-08-08 09:49:55 +09:00
parent 278372d171
commit 60903ec1f7
2 changed files with 12 additions and 4 deletions

View file

@ -20,6 +20,12 @@ SUGGESTED_QUERY_LOADED_STATUS = "추천 쿼리를 입력했습니다. 실행 버
# Client-side guard message when a reject/correct decision is missing its memo.
MEMO_REQUIRED_ERROR = "반려 또는 보정 결정에는 메모가 필요합니다."
# Uploading runs the real analysis pipeline server-side (decode, fingerprints,
# YuNet face detection) before the case appears in the queue, so this path needs
# far more headroom than a mocked-bootstrap wait. At 10s it passed standalone but
# failed inside the full suite, where the other specs contend for the same CPU.
UPLOAD_ANALYSIS_TIMEOUT_MS = 30000
class OperatorWorkbench:
"""Drives the operator GUI for browser-level (E2E) assertions."""
@ -123,7 +129,9 @@ class OperatorWorkbench:
self.page.get_by_role("button", name="사진 넣기").click()
return self
def upload_and_open(self, file_path: str, case_id: str, timeout: int = 10000) -> "OperatorWorkbench":
def upload_and_open(
self, file_path: str, case_id: str, timeout: int = UPLOAD_ANALYSIS_TIMEOUT_MS
) -> "OperatorWorkbench":
"""Upload an image and wait until its new case is queued and the workbench opens."""
self.upload_submission(file_path)
self.confirm_upload()

View file

@ -3,7 +3,7 @@ from __future__ import annotations
import pytest
from .pages import OperatorWorkbench
from .pages.workbench_page import SUGGESTED_QUERY_LOADED_STATUS
from .pages.workbench_page import SUGGESTED_QUERY_LOADED_STATUS, UPLOAD_ANALYSIS_TIMEOUT_MS
def _bootstrap_payload():
@ -104,8 +104,8 @@ def test_browser_uploads_image_and_selects_new_submission(operator_server, opera
assert workbench.submission_image_name.inner_text() == "smoke upload.svg"
workbench.confirm_upload()
workbench.wait_for_case("smoke-upload", state="attached", timeout=10000)
workbench.workbench_view.wait_for(state="visible", timeout=10000)
workbench.wait_for_case("smoke-upload", state="attached", timeout=UPLOAD_ANALYSIS_TIMEOUT_MS)
workbench.workbench_view.wait_for(state="visible", timeout=UPLOAD_ANALYSIS_TIMEOUT_MS)
assert (operator_server.image_root / "images" / "smoke-upload.svg").exists()
assert (