fix(ops): wait for metrics bridge reload
This commit is contained in:
@@ -157,6 +157,27 @@ def test_metrics_canary_requires_ewoooc_product_markers():
|
||||
assert _parse_metrics_canary(wrong_exporter) == ("200", False)
|
||||
|
||||
|
||||
def test_metrics_canary_waits_for_new_nginx_worker(monkeypatch):
|
||||
from services import metrics_edge_controlled_apply_service as service
|
||||
|
||||
outputs = iter([
|
||||
"forbidden\n__EWOOOC_HTTP_STATUS__:403",
|
||||
(
|
||||
"momo_app_info 1\nmomo_app_health 1\nmomo_database_up 1"
|
||||
"\n__EWOOOC_HTTP_STATUS__:200"
|
||||
),
|
||||
])
|
||||
|
||||
monkeypatch.setattr(
|
||||
service,
|
||||
"_run",
|
||||
lambda _command: type("Completed", (), {"stdout": next(outputs)})(),
|
||||
)
|
||||
monkeypatch.setattr(service.time, "sleep", lambda _seconds: None)
|
||||
|
||||
assert service._wait_metrics_canary(["curl"], 10) == ("200", True, 2)
|
||||
|
||||
|
||||
def test_target_health_rejects_stale_scrape_url():
|
||||
from services.metrics_edge_controlled_apply_service import _target_health_from_payload
|
||||
|
||||
|
||||
Reference in New Issue
Block a user