Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Preserve shared queue weights and causal cleanup proof

pulse-triage[bot]aa054f1cd7e1
diff --git a/.github/scripts/go-package-test-seconds.txt b/.github/scripts/go-package-test-seconds.txt
index f5422f9a3d..0946e5da47 100644
--- a/.github/scripts/go-package-test-seconds.txt
+++ b/.github/scripts/go-package-test-seconds.txt
@@ -3,7 +3,10 @@
# 41371985948 (candidate 4fc752b4, checkout 87ea1002), 2 November 2026.
# Whole-package weights are median observed task wall times, including
# per-package Go startup/compilation. The separate monitoring/installer
-# slice weights and their source-order boundaries are unchanged. Overlapping times are not workflow wall-time forecasts.
+# slice weights and their source-order boundaries are unchanged. Overlapping
+# times are not workflow wall-time forecasts. The shared release queue still
+# runs these two packages whole: retain their 9 October whole-package hints,
+# since the new sliced observations do not measure their complete binaries.
# Checked-out go list alone defines coverage. Stale names cannot add or
# remove packages; new packages use the mean measured sub-20s task cost.
# Preserve both required checks, four slots per shard and race/time limits.
@@ -18,6 +21,7 @@ github.com/rcourtman/pulse-go-rewrite/internal/config 275.333
github.com/rcourtman/pulse-go-rewrite/internal/dockeragent 123.752
github.com/rcourtman/pulse-go-rewrite/internal/hostagent 22.885
github.com/rcourtman/pulse-go-rewrite/internal/mock 130.077
+github.com/rcourtman/pulse-go-rewrite/internal/monitoring 314.522
github.com/rcourtman/pulse-go-rewrite/internal/notifications 209.899
github.com/rcourtman/pulse-go-rewrite/internal/recovery/store 24.909
github.com/rcourtman/pulse-go-rewrite/internal/relay 73.068
@@ -30,4 +34,5 @@ github.com/rcourtman/pulse-go-rewrite/pkg/db 52.639
github.com/rcourtman/pulse-go-rewrite/pkg/metrics 514.654
github.com/rcourtman/pulse-go-rewrite/pkg/proxmox 39.225
github.com/rcourtman/pulse-go-rewrite/pkg/server 57.043
+github.com/rcourtman/pulse-go-rewrite/scripts/installtests 360.228
github.com/rcourtman/pulse-go-rewrite/tests/migration 84.480
diff --git a/scripts/tests/test_go_package_shards.py b/scripts/tests/test_go_package_shards.py
index 52068156c8..34f11c9552 100644
--- a/scripts/tests/test_go_package_shards.py
+++ b/scripts/tests/test_go_package_shards.py
@@ -112,6 +112,16 @@ class PackageShardsTest(unittest.TestCase):
self.assertGreater(len(weights), 0)
self.assertTrue(all(value > 0 for value in weights.values()))
+ def test_sliced_ci_packages_keep_whole_package_hints_for_the_shared_queue(self):
+ # CI's ordinary-package samples exclude these sliced packages, but
+ # the shared backend queue still executes their complete binaries.
+ # A partial refresh must not turn known long packages into unmeasured
+ # default-cost work. Do not freeze their historical numeric estimates.
+ weights, default = selector.read_weights(ROOT / ".github/scripts/go-package-test-seconds.txt")
+ for package in ("internal/monitoring", "scripts/installtests"):
+ with self.subTest(package=package):
+ self.assertGreater(weights["github.com/rcourtman/pulse-go-rewrite/" + package], default)
+
if __name__ == "__main__":
unittest.main()
diff --git a/scripts/tests/test_release_backend_queue.py b/scripts/tests/test_release_backend_queue.py
index 594212852c..e359c87e13 100644
--- a/scripts/tests/test_release_backend_queue.py
+++ b/scripts/tests/test_release_backend_queue.py
@@ -71,6 +71,10 @@ def record(event):
data=os.environ["PULSE_DATA_DIR"], ignores_term=ignores_term,
time=time.monotonic())) + "\n")
record("start")
+if ignores_term:
+ # Signal readiness only after installing SIG_IGN and journalling the
+ # child's own start. The failure witness must not depend on weight order.
+ (root / "resistant-ready").touch()
# A disposable VM may schedule the tiny fixture processes far apart. Use a
# causal barrier, not a .6-second timing race, to prove that a short API shard
# admits another package while both the prefix and first package remain live.
@@ -84,6 +88,12 @@ if os.environ["QUEUE_CPUS"] == "4":
if time.monotonic() >= deadline:
sys.exit(97)
time.sleep(.01)
+if os.environ.get("QUEUE_WAIT_FOR_RESISTANT") and name == os.environ.get("QUEUE_FAIL"):
+ deadline = time.monotonic() + 10
+ while not (root / "resistant-ready").exists():
+ if time.monotonic() >= deadline:
+ sys.exit(98)
+ time.sleep(.01)
time.sleep(delay)
if os.environ.get("QUEUE_ORPHAN") and name.endswith("internal/monitoring"):
ready = root / "orphan-ready"
@@ -102,7 +112,7 @@ if os.environ.get("QUEUE_FAIL") in (name, "api" if selected else "other"):
@unittest.skipUnless(sys.platform == "linux", "release backend runner uses Linux Bash job control")
class ReleaseBackendQueueTest(unittest.TestCase):
- def run_queue(self, cpus=4, packages=None, **extra):
+ def run_queue(self, cpus=4, packages=None, package_weights=None, **extra):
with tempfile.TemporaryDirectory() as directory:
root = Path(directory)
for name in ("scripts", ".github/scripts", "internal/api", "bin"):
@@ -111,6 +121,8 @@ class ReleaseBackendQueueTest(unittest.TestCase):
".github/scripts/select-go-package-shard.py",
".github/scripts/go-package-test-seconds.txt"):
shutil.copyfile(ROOT / name, root / name)
+ if package_weights is not None:
+ (root / ".github/scripts/go-package-test-seconds.txt").write_text(package_weights)
assets = root / "scripts/ensure_test_assets.sh"
assets.write_text("#!/bin/bash\nexit 0\n"); assets.chmod(0o755)
for name, text in {
@@ -208,12 +220,22 @@ class ReleaseBackendQueueTest(unittest.TestCase):
self.assertNotIn("Race-enabled backend release tests passed", result.stdout)
def test_failure_escalates_for_a_child_ignoring_term(self):
- result, events, _, _ = self.run_queue(
- QUEUE_FAIL=MODULE + "internal/monitoring", QUEUE_IGNORE_TERM="1")
- self.assertEqual(result.returncode, 19, result.stdout + result.stderr)
- resistant = [e for e in events if e["ignores_term"]]
- self.assertEqual([e["event"] for e in resistant], ["start"])
- self.assertNotIn("Race-enabled backend release tests passed", result.stdout)
+ # Exercise shipped hints plus both task orders. The monitored failure
+ # waits for the resistant child's readiness instead of racing the
+ # scheduler or relying on a particular historical estimate.
+ for first in (None, "scripts/installtests", "internal/monitoring"):
+ with self.subTest(first=first):
+ weights = None if first is None else f"DEFAULT_WEIGHT 1\n{MODULE}{first} 100\n"
+ result, events, _, _ = self.run_queue(
+ package_weights=weights, QUEUE_WAIT_FOR_RESISTANT="1",
+ QUEUE_FAIL=MODULE + "internal/monitoring", QUEUE_IGNORE_TERM="1")
+ self.assertEqual(result.returncode, 19, result.stdout + result.stderr)
+ resistant = [e for e in events if e["ignores_term"]]
+ self.assertEqual([e["event"] for e in resistant], ["start"])
+ failed = next(e for e in events if e["event"] == "finish"
+ and e["name"] == MODULE + "internal/monitoring")
+ self.assertLess(resistant[0]["time"], failed["time"])
+ self.assertNotIn("Race-enabled backend release tests passed", result.stdout)
def test_wait_preserves_already_completed_child_status(self):
source = (ROOT / "scripts/run-release-backend-tests.sh").read_text()