From c69c04836119c8e6ce9fa74b06ea8e9f85610dd7 Mon Sep 17 00:00:00 2001 From: can1357 Date: Mon, 13 Jul 2026 18:51:34 +0200 Subject: [PATCH] ci: stabilized test runs by resetting settings and shrinking UI/TUI chunks - Initialized in-memory settings in the repro issue test by resetting settings before theme setup. - Reduced the UI/TUI CI test bucket chunk size from 10 to 5 to avoid cumulative Bun GC heap aborts. --- .../repro-issue-1955-sendmessage-double-render.test.ts | 4 ++++ scripts/ci-test-ts.ts | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/coding-agent/test/repro-issue-1955-sendmessage-double-render.test.ts b/packages/coding-agent/test/repro-issue-1955-sendmessage-double-render.test.ts index 239790ed8..fbc75a45b 100644 --- a/packages/coding-agent/test/repro-issue-1955-sendmessage-double-render.test.ts +++ b/packages/coding-agent/test/repro-issue-1955-sendmessage-double-render.test.ts @@ -1,6 +1,7 @@ import { afterEach, beforeAll, describe, expect, test, vi } from "bun:test"; import type { AgentMessage } from "@oh-my-pi/pi-agent-core"; import type { ImageContent, TextContent } from "@oh-my-pi/pi-ai"; +import { resetSettingsForTest, Settings } from "@oh-my-pi/pi-coding-agent/config/settings"; import type { ExtensionActions, ExtensionCommandContextActions, @@ -31,6 +32,9 @@ import { Container } from "@oh-my-pi/pi-tui"; * leaving two identical custom-message components in the chat. */ beforeAll(async () => { + // renderInitialMessages reads the global Settings (display.collapseCompacted). + resetSettingsForTest(); + await Settings.init({ inMemory: true }); await initTheme(); }); diff --git a/scripts/ci-test-ts.ts b/scripts/ci-test-ts.ts index e43a75d12..ac4ff2736 100755 --- a/scripts/ci-test-ts.ts +++ b/scripts/ci-test-ts.ts @@ -64,9 +64,17 @@ const validModes: Record = { // under the CI runner's OOM ceiling (a single 170–370-file invocation gets // SIGKILLed at 137). The singleton/global-state bucket is left whole: its suites // co-locate in one process to exercise process-wide state, so they must not split. +// +// The UI/TUI bucket uses a smaller chunk (5) than the others: its suites build up +// native ghostty-vt cells, and bun 1.3.14's GC aborts (SIGTRAP/SIGABRT, exit +// 133/134 inside DOMGCOutputConstraint marking) once ~10 such files share a heap, +// even with the GC-marker knobs below. Bisection showed no single file is at +// fault — the crash is cumulative heap volume. Under a 256MB-forced heap, a +// 10-file chunk aborts ~50% of runs while either 5-file half is 0/20; halving the +// chunk keeps each process under the threshold. const codingAgentBucketPlans: Record = { singleton: { label: "singleton/global-state bucket", parallel: 1 }, - ui: { label: "UI/TUI bucket", parallel: 1, chunkSize: 10 }, + ui: { label: "UI/TUI bucket", parallel: 1, chunkSize: 5 }, runtime: { label: "runtime/session bucket", parallel: 1, chunkSize: 10 }, native: { label: "native/tooling/browser/unit bucket", parallel: 1, chunkSize: 10 }, };