fix(queue,watch): grant line after a wait; make *-down targets are teardown
queue.py hold printed nothing when a waiting hold got its grant, so a quiet command such as node --check looked like a silent exit (Quality, test-324: history shows it ran 5 s, exit 0). A hold that printed a wait line now prints 'granted after waiting; running <cmd>'; holds granted at once stay quiet. watch.py counted every make target starting with test, quality or verify- as heavy, which queued make test-runner-down behind the gate it was meant to relieve (Stage 2.0); a target ending in -down is never heavy. 🎯 Fix: 94 % 💥 Break: 3 % 💸 Tokens: 100 % ⏱️ Velocity: 100 % 🛡️ Security: 100 % 🏆 Score: 91 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1b7d2d51a3
commit
d768851b8b
4 files changed
+10
-2
No files matched your search
@@ -366,6 +366,7 @@ KNOWN = INERT | DIRECTORY_CHANGES | frozenset({
|
||||
"git", "gh", "pip", "pip3", "pipx", "apt", "apt-get", "pacman", "brew", "dnf", "bash", "sh", "zsh", "dash",
|
||||
})
|
||||
HEAVY_MAKE = ("test", "quality", "verify-")
|
||||
TEARDOWN_MAKE = "-down"
|
||||
LIGHT_KIND = "test-nostack"
|
||||
HEAVY_KIND = "test"
|
||||
PYTEST_VALUE_OPTIONS = frozenset({
|
||||
@@ -1519,7 +1520,9 @@ def dry_run(args: list[str]) -> bool:
|
||||
|
||||
def heavy_make(args: list[str]) -> bool:
|
||||
targets = make_targets(args)
|
||||
return not dry_run(args) and (not targets or any(target == "install" or target.startswith(HEAVY_MAKE) for target in targets))
|
||||
return not dry_run(args) and (not targets or any(
|
||||
target == "install" or (target.startswith(HEAVY_MAKE) and not target.endswith(TEARDOWN_MAKE)) for target in targets
|
||||
))
|
||||
|
||||
|
||||
def heavy_compose(args: list[str]) -> bool:
|
||||
|
||||
@@ -1420,6 +1420,8 @@ def wait(cfg: dict, entry_id: str, caught: list[int]) -> tuple[int | None, int]:
|
||||
**{GRANTED_MEM: mem, FROZEN: footprint(mine[0], signatures, kinds)})
|
||||
data[GRANTED] = now
|
||||
data.pop(STALL, None)
|
||||
if shown is not None:
|
||||
print(f"queue: {entry_id} granted after waiting; running {mine[0]['cmd']}", file=sys.stderr, flush=True)
|
||||
return None, concurrent
|
||||
sends, clean, log = stalled(data, order, verdicts, cfg["thresholds_gb"]["stop"], free,
|
||||
functools.partial(cleanup_outcome, now), now)
|
||||
|
||||
+2
-1
@@ -1803,11 +1803,12 @@ class TestQueueCommands(unittest.TestCase):
|
||||
def test_a_waiting_hold_is_granted_once_the_config_it_waits_on_changes(self):
|
||||
self.cfg["slot_limits"]["deploy"] = 0
|
||||
self.write_config()
|
||||
hold, _ = self.blocked_hold("true")
|
||||
hold, err = self.blocked_hold("true")
|
||||
self.cfg["slot_limits"]["deploy"] = 1
|
||||
self.write_config()
|
||||
self.assertEqual(hold.wait(timeout=60), 0)
|
||||
self.assertEqual(self.entries(), [])
|
||||
self.assertEqual(err.read_text(encoding="utf-8").splitlines()[-1], "queue: deploy-1 granted after waiting; running true")
|
||||
|
||||
def test_fresh_takes_the_new_config_and_keeps_the_last_good_one_on_a_broken_or_partial_file(self):
|
||||
queue = _load(QUEUE)
|
||||
|
||||
@@ -368,6 +368,8 @@ class TestHeavy(unittest.TestCase):
|
||||
"pytest tests/fifo.py",
|
||||
"make install-skills",
|
||||
"make -n test",
|
||||
"make test-runner-down",
|
||||
"make -C core quality-stack-down",
|
||||
"ruff check skills tests",
|
||||
):
|
||||
with self.subTest(command=command):
|
||||
|
||||
Reference in new issue
Block a user