Skip to content

test(compaction): drain fixture state and close routing history - #6057

Closed
luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:fix/compaction-fixture-cleanup
Closed

luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:fix/compaction-fixture-cleanup

Conversation

@luvs01

@luvs01 luvs01 commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

The compaction-routing suite left continuation writes and the routing-history SQLite connection alive when switching or removing fixture homes. On Windows, running it before the combo cooldown tests produced a pending-response-state failure followed by an EBUSY cleanup retry that exhausted the final hook's timeout.

Drain and clear response state, close the derived history index, and await this teardown before removing each owned fixture directory. Scope the existing icacls test seams to this routing suite: these tests use synthetic credentials and assert routing/replay behavior, while actual DACL enforcement remains covered by its dedicated tests. Restore the real runners after pending config hardening settles. No production runtime behavior, test timeout, or file-size baseline changes.

The diagnostic run confirmed ACL reapers had finished before removal failed; the remaining files included routing-history.sqlite and its WAL/SHM. With teardown fixed, the same routing-plus-cooldown sequence finishes cleanly. Temporary diagnostic logging is not included.

Verification

  • Windows: bun test tests/responses/responses-compaction-routing.test.ts tests/server/server-combo-cooldown-fallback.test.ts — 128 passed, 0 failed, 659 assertions, including final cleanup.
  • bun scripts/test.ts --changed=<base commit> against 99d0a9400 — 126 passed, 0 failed across the one selected test file; exit 0. An explicit current base avoids the local stale upstream/dev alias expanding unrelated work.
  • TypeScript, file-size ratchet, privacy scan and git diff --check passed.
  • The same 128-case sequence also passed in the local 2.67 integration candidate. This is test-lifecycle evidence, not a claim that all app/composer functionality or the full repository suite is verified.
  • No user-facing docs or screenshot changes are required for this test-only fix.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Review readiness

  • Required local validation passed with its scope documented.
  • Branch is based on the latest dev commit.
  • All correct Codex and CodeRabbit findings are fixed.
  • Ready for maintainer review.

@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Sep 27, 2026
@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 72 / 80

이 PR은 컴팩션 라우팅 테스트가 윈도우에서 다음 테스트를 깨뜨리던 뒷정리를 고친다. 테스트가 서버를 켜지 않고 핸들러를 직접 부르면, 응답 이어쓰기와 라우팅 기록 SQLite가 열린 채로 남는다. 그 다음 테스트가 홈 폴더를 바꾸거나 지울 때, 윈도우는 routing-history.sqlite와 그 옆 파일(-wal, -shm)을 아직 잡고 있다. 삭제는 "파일이 사용 중"이라 실패한다. 이 스위트를 콤보 쿨다운 테스트보다 먼저 돌리면, 그 실패 뒤 마지막 정리 훅이 제한 시간을 다 쓴다.

고친 순서는 이렇다. 각 테스트가 끝나면 응답 상태를 디스크에 반영하고 메모리에서 비운 다음, 라우팅 기록 DB를 닫는다. 이 스위트가 직접 만든 폴더는 그 작업이 끝난 뒤에 지운다. 이 파일이 실행되는 동안에는 윈도우 권한 명령 icacls를 빈 출력의 성공으로 바꾼다. 파일의 테스트가 모두 끝나면 진짜 실행기로 되돌린다. 제품 동작과 테스트 제한 시간은 이 커밋에 없다.

기준 브랜치는 dev다. 이 커밋은 dev보다 1개 앞에 있고, 뒤처진 커밋은 없다. 같은 뒷정리만 다루는 다른 열린 PR은 없다.

tests/helpers/compaction-routing-fixtures.ts:18 - installCompactionRoutingAclFixture가 이 파일 전체의 icacls를 항상 성공으로 바꾼다. 바뀐 실행기는 프로세스 전역이고, 복구는 파일 끝의 afterAll이다. 주석은 설정 폴더 강화가 정리되면 진짜 실행기로 되돌리라고 적는다. 되돌릴 이슈 번호는 없다.

tests/helpers/compaction-routing-fixtures.ts:42 - removeCompactionFixture는 응답 상태를 비우고 SQLite를 닫은 뒤 폴더를 지운다. 이미 떠 있는 icacls 자식은 flushWindowsSecretAclReapsBeforeRemoval로 기다리지 않는다. 권한 목록 자체를 보는 테스트는 tests/windows/windows-secret-acl.test.ts에 있다.

이 커밋의 Cross-platform CI에서 윈도우 샤드는 skipping이다. 리눅스 test 1/4–4/4와 ci는 통과했다. "파일이 사용 중" 실패는 작성자가 윈도우에서 라우팅 테스트와 쿨다운 테스트를 이어서 돌려 128개가 통과했다고 적은 기록으로 확인된다.

메인테이너의 판단이 필요한 지점

이 스위트에서 icacls를 가짜 성공으로 둘지 정해야 한다. 작성자는 여기 테스트가 라우팅과 재생만 보고, 윈도우 폴더 권한은 전용 테스트가 본다고 했다. 가짜를 이 파일의 정식 경계로 둘지, 강화 작업이 끝난 뒤 되돌릴 임시 장치로 둘지 고르면 된다.

너의 추천

폴더를 지우기 전에 응답 상태를 비우고 SQLite를 닫는 순서는, 남아 있던 파일과 같다. 그 부분은 유지하면 된다. icacls 가짜 성공은 파일 끝에서 진짜 실행기로 되돌리는 지금 모양을 유지하고, 이 스위트는 권한 실패를 보지 않는다는 주석을 그대로 두면 된다. 윈도우 CI 샤드가 이 커밋에서 빠졌으므로, Draft는 작성자의 윈도우 연속 실행 기록을 받아들일 때까지 두는 편이 맞다.

이 댓글은 grok-bot이 작성했습니다

@lidge-jun

Copy link
Copy Markdown
Owner

Landed on dev in #6061 (merge 06d7914e6a) as one squashed commit that keeps your authorship. Thank you. Closing because this repository merges into dev, so GitHub does not close carried PRs automatically.

@lidge-jun lidge-jun closed this Sep 27, 2026
robin-bially pushed a commit to robin-bially/opencodex that referenced this pull request Sep 27, 2026
…e-jun#6057)

Carried from lidge-jun#6057 into merge train round 3.

Co-authored-by: luvs01 <27862058+luvs01@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants