-
Notifications
You must be signed in to change notification settings - Fork 3
test(orchestrator): isolate service test pids #766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
hojinzs marked this conversation as resolved.
hojinzs marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -1905,10 +1905,12 @@ describe("OrchestratorService", () => { | |||||||
| pid: 4101, | ||||||||
| unref: vi.fn(), | ||||||||
| }); | ||||||||
| const isProcessRunning = vi.fn().mockReturnValue(false); | ||||||||
| const currentTime = new Date("2026-03-08T00:00:00.000Z"); | ||||||||
| const service = new OrchestratorService(store, projectConfig, { | ||||||||
| fetchImpl: vi.fn().mockResolvedValue(createTrackerResponse(repository)), | ||||||||
| spawnImpl: spawnImpl as never, | ||||||||
| isProcessRunning, | ||||||||
| now: () => currentTime, | ||||||||
| }); | ||||||||
|
|
||||||||
|
|
@@ -1945,6 +1947,7 @@ describe("OrchestratorService", () => { | |||||||
| ) | ||||||||
| ).resolves.toContain(`"workspaceKey": "${workspaceKey}"`); | ||||||||
| expect(spawnImpl).toHaveBeenCalledTimes(1); | ||||||||
| expect(isProcessRunning).toHaveBeenCalledWith(4101); | ||||||||
|
hojinzs marked this conversation as resolved.
|
||||||||
| expect((await store.loadAllRuns())[0]?.trackerItemId).toBe("item-1"); | ||||||||
| expect(spawnImpl).toHaveBeenCalledWith( | ||||||||
| "bash", | ||||||||
|
|
@@ -3720,6 +3723,7 @@ Retry inconclusive work. | |||||||
| const stderr = { | ||||||||
| write: vi.fn().mockReturnValue(true), | ||||||||
| }; | ||||||||
| const isProcessRunning = vi.fn().mockReturnValue(false); | ||||||||
|
|
||||||||
| const service = new OrchestratorService(store, projectConfig, { | ||||||||
| fetchImpl: vi | ||||||||
|
|
@@ -3728,6 +3732,7 @@ Retry inconclusive work. | |||||||
| createTrackerResponseWithState(repository, "Todo") | ||||||||
| ) as never, | ||||||||
| spawnImpl: vi.fn().mockReturnValue(worker) as never, | ||||||||
| isProcessRunning, | ||||||||
| now: () => new Date("2026-03-08T00:00:00.000Z"), | ||||||||
| stderr, | ||||||||
| logLevel: "verbose", | ||||||||
|
|
@@ -3755,6 +3760,7 @@ Retry inconclusive work. | |||||||
| `[retry-scheduled] ${runId} kind=continuation attempt=1 nextAt=2026-03-08T00:00:01.000Z\n` | ||||||||
| ); | ||||||||
| expect(output).toContain(`[run-completed] ${runId} status=retrying\n`); | ||||||||
| expect(isProcessRunning).toHaveBeenCalledWith(4102); | ||||||||
| }); | ||||||||
|
|
||||||||
| it("invokes onTick with the reconciliation snapshot when run() completes a tick", async () => { | ||||||||
|
|
@@ -7296,6 +7302,7 @@ Prefer focused changes. | |||||||
| await store.saveProjectConfig(projectConfig); | ||||||||
|
|
||||||||
| const workers: EventEmitter[] = []; | ||||||||
| const isProcessRunning = vi.fn().mockReturnValue(false); | ||||||||
| const spawnImpl = vi.fn().mockImplementation(() => { | ||||||||
| const worker = new EventEmitter() as EventEmitter & { | ||||||||
| pid: number; | ||||||||
|
|
@@ -7323,6 +7330,7 @@ Prefer focused changes. | |||||||
| return createTrackerResponseWithState(repository, "Ready") as Response; | ||||||||
| }) as never, | ||||||||
| spawnImpl: spawnImpl as never, | ||||||||
| isProcessRunning, | ||||||||
| now: () => now, | ||||||||
| }); | ||||||||
|
|
||||||||
|
|
@@ -7339,6 +7347,7 @@ Prefer focused changes. | |||||||
| expect(retryWorkerEnv?.SYMPHONY_RENDERED_PROMPT).toContain( | ||||||||
| "retry_attempt=1" | ||||||||
| ); | ||||||||
| expect(isProcessRunning).toHaveBeenCalledWith(4310); | ||||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1 해소 확인 — 1라운드에서 재현했던 실패가 사라졌습니다. 동일한 시뮬레이션(
base 에서 깨진 4건이 정확히 이 PR 이 손댄 4건(이슈 명시 2건 + P1 + P2)과 일치합니다. 이 테스트도 그중 하나였고 이제 통과합니다.
Generated by Claude Code |
||||||||
| }); | ||||||||
|
|
||||||||
| it("renders a queued failure retry attempt during ordinary dispatch", async () => { | ||||||||
|
|
@@ -15802,12 +15811,14 @@ Prefer focused changes. | |||||||
| nextRetryAt: null, | ||||||||
| }); | ||||||||
|
|
||||||||
| const isProcessRunning = vi.fn().mockReturnValue(false); | ||||||||
| const service = new OrchestratorService(store, projectConfig, { | ||||||||
| fetchImpl: vi.fn().mockResolvedValue(createEmptyTrackerResponse()), | ||||||||
| spawnImpl: vi.fn().mockReturnValue({ | ||||||||
| pid: 4202, | ||||||||
| unref: vi.fn(), | ||||||||
| }) as never, | ||||||||
| isProcessRunning, | ||||||||
| now: () => new Date("2026-03-08T00:00:00.000Z"), | ||||||||
| }); | ||||||||
|
|
||||||||
|
|
@@ -15824,6 +15835,7 @@ Prefer focused changes. | |||||||
|
|
||||||||
| expect(workspacePathFromHook).toBe(expectedWorkspacePath); | ||||||||
| expect(repositoryPathFromHook).toBe(repository.path); | ||||||||
| expect(isProcessRunning).toHaveBeenCalledWith(999999); | ||||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2 해소 확인 + 같은 부류의 잔존 노출면 1건 (이 PR 범위 밖, 별도 이슈 제안 — nit) 영속 추가로 orchestrator 패키지 전체를 같은 방식으로(패키지 내 테스트의 pid 리터럴 78개 전부 생존 처리) 돌려봤습니다.
다만 패키지 밖에 같은 부류가 하나 남아 있어 기록만 남깁니다. (cli 패키지 pid 리터럴 생존 시뮬레이션: 1 failed / 590 passed. pid 999999 가 살아 있으면 stale run 이 recoverable 로 잡히지 않아 실패합니다.) 이 PR 에서 고치실 필요 없습니다. main 에 이미 있던 것이고 #762 의 명시 범위(orchestrator)도 아닙니다. Generated by Claude Code |
||||||||
| }); | ||||||||
| }); | ||||||||
|
|
||||||||
|
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.