Files
detections/e2e/tests/test_resource_limits.py
T
Oleksandr Bezdieniezhnykh 8baa96978b [AZ-180] Refactor detection event handling and improve SSE support
- Updated the detection image endpoint to require a channel ID for event streaming.
- Introduced a new endpoint for streaming detection events, allowing clients to receive real-time updates.
- Enhanced the internal buffering mechanism for detection events to manage multiple channels.
- Refactored the inference module to support the new event handling structure.

Made-with: Cursor
2026-04-03 02:42:05 +03:00

34 lines
1.1 KiB
Python

import re
from datetime import datetime
from pathlib import Path
import pytest
@pytest.mark.slow
@pytest.mark.timeout(120)
def test_nft_res_lim_03_max_detections_per_frame(
warm_engine, image_detect, image_dense
):
detections, _ = image_detect(image_dense, "img.jpg", timeout=120)
assert isinstance(detections, list)
assert len(detections) <= 300
@pytest.mark.slow
def test_nft_res_lim_04_log_file_rotation(warm_engine, image_detect, image_small):
image_detect(image_small, "img.jpg", timeout=60)
candidates = [
Path(__file__).resolve().parent.parent / "logs",
Path("/app/Logs"),
]
log_dir = next((p for p in candidates if p.is_dir()), None)
if log_dir is None:
pytest.skip("Log directory not accessible from e2e-runner container")
today = datetime.now().strftime("%Y%m%d")
expected = f"log_inference_{today}.txt"
names = {p.name for p in log_dir.iterdir() if p.is_file()}
if expected not in names:
pat = re.compile(r"^log_inference_\d{8}\.txt$")
assert any(pat.match(n) for n in names), names