chore: bump version to 10.0.4
Reverts v10.0.3 chroma-mcp spawn storm fix (broken release). Restores codebase to v10.0.2 state. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,6 @@ import {
|
||||
removePidFile,
|
||||
getPlatformTimeout,
|
||||
parseElapsedTime,
|
||||
cleanupExcessChromaProcesses,
|
||||
isProcessAlive,
|
||||
cleanStalePidFile,
|
||||
spawnDaemon,
|
||||
@@ -226,65 +225,6 @@ describe('ProcessManager', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('cleanupExcessChromaProcesses (Issue #1063)', () => {
|
||||
/**
|
||||
* Tests for count-based chroma-mcp process cleanup.
|
||||
* Unlike the age-based cleanupOrphanedProcesses() which has a 30-minute
|
||||
* threshold, this function kills by count — essential for catching spawn
|
||||
* storms where all processes are young.
|
||||
*/
|
||||
|
||||
it('should be exported and callable', () => {
|
||||
expect(typeof cleanupExcessChromaProcesses).toBe('function');
|
||||
});
|
||||
|
||||
it('should return 0 on Windows (Chroma disabled)', async () => {
|
||||
const originalPlatform = process.platform;
|
||||
Object.defineProperty(process, 'platform', {
|
||||
value: 'win32',
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
try {
|
||||
const killed = await cleanupExcessChromaProcesses();
|
||||
expect(killed).toBe(0);
|
||||
} finally {
|
||||
Object.defineProperty(process, 'platform', {
|
||||
value: originalPlatform,
|
||||
writable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
it('should accept custom maxAllowed parameter', async () => {
|
||||
// Should not throw with any valid maxAllowed value
|
||||
const killed = await cleanupExcessChromaProcesses(5);
|
||||
expect(killed).toBeGreaterThanOrEqual(0);
|
||||
});
|
||||
|
||||
it('should return a number (killed count)', async () => {
|
||||
const killed = await cleanupExcessChromaProcesses();
|
||||
expect(typeof killed).toBe('number');
|
||||
expect(killed).toBeGreaterThanOrEqual(0);
|
||||
});
|
||||
|
||||
it('should exist in ProcessManager source with count-based logic', async () => {
|
||||
const sourceFile = await Bun.file(
|
||||
new URL('../../src/services/infrastructure/ProcessManager.ts', import.meta.url)
|
||||
).text();
|
||||
|
||||
// Verify count-based logic exists (not age-based)
|
||||
expect(sourceFile).toContain('cleanupExcessChromaProcesses');
|
||||
expect(sourceFile).toContain('chroma-mcp');
|
||||
|
||||
// Should sort by age and keep newest
|
||||
expect(sourceFile).toContain('.sort(');
|
||||
expect(sourceFile).toContain('.slice(maxAllowed)');
|
||||
});
|
||||
});
|
||||
|
||||
describe('isProcessAlive', () => {
|
||||
it('should return true for the current process', () => {
|
||||
expect(isProcessAlive(process.pid)).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user