Files
Dragan Spiridonov 3efc40953c fix(ci): add OS-level timeout guards and fix hanging tests (#350)
Tests in 6 CI shards were hanging indefinitely in native code (HNSW,
QEReasoningBank, SQLite), causing GitHub to report them as "cancelled"
at the job timeout-minutes boundary with no diagnostic output.

Root cause: vitest's JS-level testTimeout (10s) cannot interrupt native
C++ code. When bank.initialize() or server.invoke() blocked in HNSW
index loading or cross-domain transfers, the forked process stalled
until the GitHub job timeout killed it silently.

Workflow changes (optimized-ci.yml, mcp-tools-test.yml):
- Wrap all vitest commands in `timeout 480` (8 min OS-level SIGTERM)
  so hangs produce a clear failure (exit 124) instead of silent cancel
- Add --reporter=verbose to identify which test was last running

Test fixes:
- mcp-server.test.ts: add Promise.race timeout guards to all domain
  tool invocations (coverage_analyze, security_scan, test_generate)
  and fleet_init beforeEach — these call real handlers that can hang
- rvf-production-wiring.test.ts: add withTimeout() guards around
  bank.initialize(), writer.initialize(), bank.dispose() which load
  HNSW indices and cross-domain transfers via native code

Verified: rvf-production-wiring previously hung indefinitely (killed
by timeout 120 locally); now completes in 907ms. MCP Root Files shard
(122 tests) completes in 10.7s.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-21 08:36:02 +00:00
..