fix: address CodeRabbit review feedback on PR #1491

- Update POST_SPAWN_WAIT test assertion from 5000 to 15000 to match
  the constant change in hook-constants.ts
- Remove redundant readPidFile() from aggressiveStartupCleanup() —
  start() writes the new PID before this runs, so it always returns
  process.pid (already protected)
- Add waitForReadiness() to the reused-worker path in
  ensureWorkerStarted() to prevent concurrent hooks from racing
  past a cold-starting worker's initialization guard

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Ryan Malia
2026-03-25 15:02:09 -07:00
parent 88b47f9e9c
commit 83f61177c7
4 changed files with 93 additions and 87 deletions
+2 -2
View File
@@ -32,8 +32,8 @@ describe('hook-constants', () => {
expect(HOOK_TIMEOUTS.HEALTH_CHECK).toBe(3000);
});
it('should define POST_SPAWN_WAIT as 5s', () => {
expect(HOOK_TIMEOUTS.POST_SPAWN_WAIT).toBe(5000);
it('should define POST_SPAWN_WAIT as 15s', () => {
expect(HOOK_TIMEOUTS.POST_SPAWN_WAIT).toBe(15000);
});
it('should define PORT_IN_USE_WAIT as 3s', () => {