Реплика больше не держит корректность в своей памяти: сессия в Redis, а повтор POST сообщения фиксируется в Postgres вместе с X-Instance-Id.
25 lines
555 B
Python
25 lines
555 B
Python
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
sys.path.insert(0, str(ROOT / "tests"))
|
|
from client import Client, Failure # noqa: E402
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def base_url():
|
|
return os.environ.get("BASE_URL", "http://127.0.0.1:8080")
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def live(base_url):
|
|
c = Client(base_url, timeout=15)
|
|
try:
|
|
c.call("GET", "/health/ready", schema="Health")
|
|
except Failure as exc:
|
|
pytest.skip("API is not ready: %s" % exc)
|
|
return c
|