Run tests: execution options follow the configured schedulers; the queued-cancel test cancels whichever run Dagster left queued and checks none of its steps ran

This commit is contained in:
2026-11-29 07:43:49 -06:00
parent c7caf56f83
commit f830003abd
2 changed files with 28 additions and 8 deletions
+10 -2
View File
@@ -1,5 +1,6 @@
"""Run shaping and the API's Dagster-backed run and execution routes."""
import os
import time
import pytest
@@ -209,11 +210,18 @@ def test_run_requests_validate_the_execution_choice(api_with_dagster_address):
def test_execution_options_and_health(api):
options = _ok(api.get("/execution/options"))
assert options["default_mode"] == "sync"
assert options["schedulers"] == []
configured = [s for s in os.environ.get("DASK_SCHEDULERS", "").split(",") if s]
assert options["schedulers"] == configured # compose and CI name the test scheduler
health = _ok(api.get("/execution/health", params={"mode": "local"}))
assert health["reachable"] is True
assert health["workers"] >= 1
assert api.get("/execution/health", params={"mode": "remote"}).status_code == 422
if configured:
remote = {"mode": "remote", "scheduler": configured[0]}
health = _ok(api.get("/execution/health", params=remote))
assert health["reachable"] is True
assert health["workers"] == int(os.environ.get("DASK_EXPECTED_WORKERS", "1"))
else:
assert api.get("/execution/health", params={"mode": "remote"}).status_code == 422
assert api.get("/execution/health?mode=sync&reference=..%2Fx").status_code == 422