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:
+10
-2
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user