Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

ci(ubicloud): end the run once every item has a result instead of waiting on a VM stuck waiting for capacity

garrytana4e70a55ec6d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9568975530..5644a4c4ab 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,7 +28,7 @@ No user-facing behavior changes. `bun run ci:ubicloud`, the full pre-ship gate f
- **Long-pole files split.** The files that ran past two and a half minutes are now files of about two minutes, with every test body unchanged and shared steps in helpers: `graduation-cli` (agent flow, topologies, the 1k-page history round trip, and zero-mutation polling split three ways by custody boundary), `graduation-crash-run-{1,2,3}` and `graduation-crash-rollback-{1,2}`, `graduation-clients` and `graduation-clients-serve`, `reconcile-crash-{unactivated,activated}-{1,2}.slow`, and `write-attribution-timeline-10k-postgres` (backend matrix). The GitHub Tier 1 graduation step, the selected-E2E exclusions, the per-file timeouts, persistence-validation, the nightly slow coverage lane, `test-shard.sh`, the stress plan and both weight maps name the new files.
- **Faster VM setup.** The checkout is packed while VMs boot, and setup is streamed over SSH while the checkout uploads, so apt, the Bun and gitleaks downloads and the image pulls overlap it. apt skips fsync, man-db, needrestart and the translation, AppStream and command-not-found indexes, and installs `gcc` and `libc6-dev` (the native fault test compiles a shim) instead of `build-essential`. The tarball carries a `.git` with only what `HEAD` and `origin/master` reach: about 80 MB instead of 250 MB from a checkout that fetched every branch. Downloads retry, and database containers start only after apt, because a systemd reload during `docker run` failed containers.
- **Prebaked image (opt-in).** `scripts/ubicloud/build-ci-image.sh` builds the `gbrain-ci` machine image with the apt packages and database images baked in; `--image gbrain-ci@latest` or `UBI_CI_IMAGE` boots it and cuts the setup script to about 18 s.
-- **Scheduler.** The VM running gitleaks, verify and the machine-exclusive serial files no longer counts toward heavy-item spreading or total slots. While it ran, it held every other VM to one item of a minute or more, so items of 100-120 s started two minutes late.
+- **Scheduler.** The VM running gitleaks, verify and the machine-exclusive serial files no longer counts toward heavy-item spreading or total slots. While it ran, it held every other VM to one item of a minute or more, so items of 100-120 s started two minutes late. A run now ends as soon as every item has a result, instead of waiting for a VM still `waiting for capacity`; teardown destroys it.
- **P2 held-out E1 record.** `docs/eval/decisions/p2-e1-heldout/README.md` now records all 12 preregistered cells: the seed-3 hybrid cells (hub-as-answer −10.0, the capped rival still ahead on concept) confirm FAIL, as in gbrain-evals `p2.md`.
- **Slots per VM stay at 8.** On eight VMs, 12 slots raised test compute 27% and finished in 353 s, against 359 s at 8 slots. 16 slots raised compute 52% and took 444 s. Neither caused a failure.
- **`test/migrate-embeddings-recovery-cli.serial.test.ts`** never had a hung child. Its matrix test ran 126 cold CLI starts and 126 in-process PGLite reopens, one after another, inside a single 180-second budget. That took 69 s on an idle 4-core machine and more than 180 s on a shared CI runner, where the runner killed whichever child was running at the deadline ("killed 1 dangling process"). Every control is still checked on both routes, now in-process through the same `parseGlobalFlags` and `migrationCliArgumentError` call the CLI entry makes. One real CLI process runs for each distinct rejection (14 per route), and the test takes 27 s instead of 69 s. Pinned to one core beside three other serial files, the old test hit its 180 s timeout and the new one passed in 135 s.
diff --git a/scripts/ci-ubicloud.ts b/scripts/ci-ubicloud.ts
index 9303010be0..0ce2551378 100755
--- a/scripts/ci-ubicloud.ts
+++ b/scripts/ci-ubicloud.ts
@@ -352,8 +352,12 @@ async function main() {
return vm.heavy > Math.min(...peers.map((v) => v.heavy));
};
+ // Every item has a result: VMs still waiting for capacity have nothing left to do, and teardown reaps them.
+ let allRecorded = () => {};
+ const recorded = new Promise<void>((done) => (allRecorded = done));
const record = (vm: Vm, slot: number, result: ItemResult) => {
results.set(weightKey(result.lane as Lane, result.file), { ...result, vm: vm.name, slot });
+ if (results.size === totalItems) allRecorded();
if (result.rc !== 0) {
const path = join(runDir, "failures", `${result.lane}__${result.file.replace(/[\\/]/g, "__")}.log`);
writeFileSync(path, result.output + "\n");
@@ -475,7 +479,7 @@ async function main() {
let exitCode = 0;
try {
- await Promise.all(vms.map((vm, i) => vmLifecycle(vm, i)));
+ await Promise.race([Promise.all(vms.map((vm, i) => vmLifecycle(vm, i))), recorded]);
if (control.length && !controlDone) throw new Error("no VM became ready to run gitleaks/verify/exclusive items");
if (queue.length) throw new Error(`${queue.length} items never ran: every VM failed`);
} catch (error) {
diff --git a/scripts/ubicloud/README.md b/scripts/ubicloud/README.md
index 4e4fa21353..e4f475ae07 100644
--- a/scripts/ubicloud/README.md
+++ b/scripts/ubicloud/README.md
@@ -70,7 +70,8 @@ about 40 seconds to 18. It is opt-in until image boots prove as reliable as
stock ones: on its first full gate five of eight VMs sat in `waiting for
capacity`. Stock VMs hit the same wait later (six of ten in one burst), so
`eu-central-h1` capacity, not just the quota, can shrink a fleet; the run
-then continues on the VMs that did start. Rebuild the image when the package
+then continues on the VMs that did start, and it ends once every item has a
+result rather than waiting for a VM that never came up. Rebuild the image when the package
list or images change; setup still pulls the floating image tags, so a stale
image costs time, not correctness.