Commit Graph

2 Commits

Author SHA1 Message Date
Dragan Spiridonov 9e314ff383 fix(tests): unblock full unit suite and drop force-exit hack (#396)
The full `npx vitest run tests/unit/` suite was hanging >22 minutes
since v3.9.1 due to a futex deadlock in `@ruvector/router` native NAPI
calls during HNSW VectorDb operations. v3.9.5 already addressed the
root cause by flipping `useNativeHNSW` default from true to false
(commit 3a1d9636). This commit closes the loop by:

1. Fixing the one fallout test introduced by that flag flip:
   `tests/unit/cli/commands/ruvector-commands.test.ts:110` was setting
   `useNativeHNSW: false` to test the (modified) marker, but false is
   now the default, so the marker never appeared. Flipped to `true`.

2. Removing the `tests/setup-worker.ts` `process.exit(0)` force-exit
   hack. It was added as a band-aid when fork workers hung on lingering
   native handles. Since v3.9.3 added the `dispose()` contract on HNSW
   backends and v3.9.5 disabled native HNSW by default, workers now
   exit cleanly on their own. The 5-second main-process safety net in
   `tests/global-teardown.ts` is intentionally kept as a last resort.

Verification (full `tests/unit/`, 505 files):
- Before this PR (with hack):    7m26s, 1 failed,  16308 passed
- After  this PR (no hack):      6m21s, 0 failed,  16309 passed

The 1m05s saved comes from the per-file 2s force-exit delays the hack
was adding, even though the timer was unref'd.

Closes #396

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 15:15:04 +00:00
Dragan Spiridonov 4e513b431d fix: resolve 3 P0 blockers and CI failures from QE v3.8.13 audit
- Delete dead MCP server.ts (911 lines, never used in production — entry.ts
  imports MCPProtocolServer). Add legacy aliases in index.ts for backwards compat.
- Fix ESLint: rename .eslintrc.js to .eslintrc.cjs (CommonJS in ESM project)
- Fix hardcoded version '3.0.0' in protocol-server.ts and http-server.ts —
  now reads dynamically from package.json
- Fix vitest process hang: add worker-level afterAll force-exit (setup-worker.ts)
  and global teardown safety net. Native modules (better-sqlite3, hnswlib-node)
  held open handles preventing fork worker exit.
- Add test gate to npm-publish.yml — 194 unit test files must pass before publish
- Disable benchmark.yml release trigger (benchmarks/suite.ts doesn't exist)
- Remove continue-on-error from test steps in optimized-ci.yml (was masking failures)
- Add getToolDefinitions() to MCPProtocolServer for test introspection
- Update e2e and integration tests to use production server API

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 16:51:59 +00:00