Skip to content

Commit 4e99c05

Browse files
committed
test(cli): the uninstall orders run two at a time, not four
Four live os start trees at once, beside the package's other workers, ran a 15 GB box out of memory. Two pairs of four boots and three installs each keep most of the saving. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DcLzU9qErDBr5VydWEmHVM
1 parent fd00753 commit 4e99c05

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

‎packages/cli/test/package-install-local-uninstall-cleanups.integration.test.ts‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@
5959
* package — `@objectstack/cloud-connection` and `@objectstack/metadata-protocol`
6060
* included — resolved through its `exports` to `dist/`, so an ablation of either
6161
* package's source reaches this file only after that package is rebuilt. Every
62-
* boot runs in `beforeAll`; the `it`s only read what the phases recorded. The
63-
* four orders run at once, each in its own cwd and home: one order's steps
64-
* run in sequence, and no order reads another's.
62+
* boot runs in `beforeAll`; the `it`s only read what the phases recorded. Each
63+
* order has its own cwd and home and runs its steps in sequence; two orders run
64+
* at a time, and no order reads another's.
6565
*/
6666

6767
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
@@ -352,10 +352,9 @@ beforeAll(async () => {
352352

353353
// The four orders share nothing but the two package directories they read:
354354
// each has its own cwd, home and ledger, and every boot binds a
355-
// kernel-assigned port. So they run at once, and the file waits for the
356-
// longest one rather than for their sum. Inside an order every step still
357-
// waits for the one before it.
358-
await allPhases([
355+
// kernel-assigned port. Inside an order every step still waits for the one
356+
// before it.
357+
const [hot, restarted, reseed, reinstall]: Array<() => Promise<void>> = [
359358
// ── order 1: hot install → DELETE → restart ────────────────────────────
360359
async () => {
361360
const hotDir = join(root, 'hot');
@@ -427,6 +426,14 @@ beforeAll(async () => {
427426
};
428427
await stopGroup(h.child);
429428
},
429+
];
430+
// Two orders at a time, paired so each pair is four boots and three installs.
431+
// ⛔ Not all four at once: every live `os start` holds well over a gigabyte,
432+
// and four of them beside the package's other workers ran a 15 GB box out of
433+
// memory (exit 137, SIGKILL).
434+
await allPhases([
435+
async () => { await hot(); await reseed(); },
436+
async () => { await restarted(); await reinstall(); },
430437
]);
431438
}, 9 * BOOT_TIMEOUT_MS);
432439

0 commit comments

Comments
 (0)