mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-13 00:19:03 +02:00
test: fix two parallelism-exposed flakes (probe re-run, live-tree census)
Both pass solo and on main but flaked under the parallel runner: 1. gstack-brain-context-load probed 'gbrain --version' PER QUERY with a 500ms budget — a cold probe on a saturated box timed out (observed 505ms), branding gbrain 'missing' for one query while siblings passed. The probe is now memoized (availability can't change mid-invocation) with a generous one-time 5s budget; query calls keep the tight timeout. 2. skill-size-budget's catalog estimate read the LIVE tree, so a concurrent worker's transient skill-shaped scratch dirs exactly doubled it (8356 vs 4177). The ratchet now counts git-TRACKED skills only — the catalog that ships, immune to sibling workers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
1e0ff1e1e2
commit
c9df02877c
@@ -190,16 +190,26 @@ function resolveSkillFile(args: CliArgs): string | null {
|
||||
|
||||
// ── Dispatchers ────────────────────────────────────────────────────────────
|
||||
|
||||
// Memoized: availability can't change mid-invocation, and the per-query
|
||||
// re-probe was both wasteful (N probes per run) and load-flaky — a cold
|
||||
// `gbrain --version` on a saturated box can exceed the 500ms budget, branding
|
||||
// gbrain "missing" for one query while its siblings succeed (observed under
|
||||
// the parallel free-suite runner: SKIP at dur=505ms with two OKs after it).
|
||||
let _gbrainAvailable: boolean | null = null;
|
||||
function gbrainAvailable(): boolean {
|
||||
if (_gbrainAvailable !== null) return _gbrainAvailable;
|
||||
try {
|
||||
execFileSync("gbrain", ["--version"], {
|
||||
stdio: "ignore",
|
||||
timeout: MCP_TIMEOUT_MS,
|
||||
// Generous first-probe budget: this runs ONCE, and a slow-to-start CLI
|
||||
// is not a missing CLI. Query calls keep the tight MCP_TIMEOUT_MS.
|
||||
timeout: 5_000,
|
||||
});
|
||||
return true;
|
||||
_gbrainAvailable = true;
|
||||
} catch {
|
||||
return false;
|
||||
_gbrainAvailable = false;
|
||||
}
|
||||
return _gbrainAvailable;
|
||||
}
|
||||
|
||||
function dispatchVector(q: GbrainManifestQuery, args: CliArgs): QueryResult {
|
||||
|
||||
Reference in New Issue
Block a user