-
Notifications
You must be signed in to change notification settings - Fork 2
fix(devtools): follow the queue runner's rename to agentctl-run #4684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,10 +53,13 @@ | |
| ] | ||
|
|
||
| #: Exported into every task started by ``sinnixd-queue-run``. | ||
| QUEUE_TASK_ENV: Final = "SINNIXD_JOB_ID" | ||
| QUEUE_TASK_ENV: Final = "AGENTCTL_JOB_ID" | ||
| #: The installed queue runner moves the workload out of pueued.service and | ||
| #: into the slice selected by the launch document's pool. | ||
| QUEUE_RUNNER: Final = "sinnixd-queue-run" | ||
| #: The queue runner, newest name first; the daemon-era name still resolves on | ||
| #: a host that has not switched. | ||
| QUEUE_RUNNERS: Final = ("agentctl-run", "sinnixd-queue-run") | ||
| QUEUE_RUNNER: Final = QUEUE_RUNNERS[0] | ||
|
Comment on lines
+61
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With the hermetic PATH in Useful? React with 馃憤聽/ 馃憥. |
||
| #: Explicit escape, for the hermetic test of this mechanism. | ||
| SLOT_ESCAPE_ENV: Final = "POLYLOGUE_PYTEST_SLOT" | ||
| SLOT_HELD: Final = "held" | ||
|
|
@@ -341,7 +344,10 @@ def _queue( | |
| launch_path = root / LAUNCH_DIR / f"pytest-slot-{identity}.json" | ||
| log_path = root / LAUNCH_DIR / f"pytest-slot-{identity}.log" | ||
| adder = adder_environment(env) | ||
| queue_runner = shutil.which(QUEUE_RUNNER, path=adder.get("PATH") or os.defpath) | ||
| queue_runner = next( | ||
| (found for name in QUEUE_RUNNERS if (found := shutil.which(name, path=adder.get("PATH") or os.defpath))), | ||
| None, | ||
| ) | ||
| if queue_runner is None: | ||
| raise PytestSlotUnavailableError(REFUSAL.format(reason=f"`{QUEUE_RUNNER}` is not on PATH")) | ||
| _write_launch( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,8 @@ | |
| from typing import Any | ||
| from uuid import UUID | ||
|
|
||
| from devtools.agent_env import runtime_env | ||
|
|
||
| _CGROUP_PATH = Path("/proc/self/cgroup") | ||
| _PROJECT_ID = "polylogue" | ||
|
|
||
|
|
@@ -81,14 +83,14 @@ def require_declared_operation_context( | |
| environment. This does not replace Sinnixd's exact-head or lease validation. | ||
| """ | ||
| env = os.environ if environment is None else environment | ||
| job_id = env.get("SINNIXD_JOB_ID", "") | ||
| job_id = runtime_env(env, "JOB_ID") or "" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 馃憤聽/ 馃憥. |
||
| unit = _unit_name(job_id) | ||
| expected = { | ||
| "SINNIXD_JOB_ID": job_id, | ||
| "SINNIXD_PROJECT_ID": _PROJECT_ID, | ||
| "SINNIXD_OPERATION": operation, | ||
| "JOB_ID": job_id, | ||
| "PROJECT_ID": _PROJECT_ID, | ||
| "OPERATION": operation, | ||
| } | ||
| if any(env.get(key) != value for key, value in expected.items()): | ||
| if any(runtime_env(env, key) != value for key, value in expected.items()): | ||
| raise ValueError("Sinnixd service context does not match the declared operation") | ||
| read_cgroup = cgroup_reader or (lambda: _CGROUP_PATH.read_text(encoding="utf-8")) | ||
| cgroup = _current_cgroup(read_cgroup) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the corpus runs through the declared
verify_affectedorverify_allAgentCTL operations, pytest inherits realAGENTCTL_OPERATION,AGENTCTL_JOB_ID, andAGENTCTL_CORRELATION_IDvalues. Tests such astest_declared_operation_requires_the_fixed_routeand the AgentCTL receipt tests only set or clear theirSINNIXD_*counterparts, so this precedence rule ignores the test values: the former returnsNoneinstead ofverify_quick, while the receipt assertions observe the runner's IDs instead ofjob-join/job-17. Update those tests or an autouse fixture to isolate both namespaces so the declared verification operations can pass.Useful? React with 馃憤聽/ 馃憥.