Files
clean-architecture-frontend…/tests/unit
DongHyeonka dae44f5cf4 test(http): interaction signal listener 정리도 고정한다
문제
실행기는 호출자·interaction·scope 세 signal에 abort listener를 달고
끝날 때 셋을 모두 지운다(src/adapters/http/http-execution-v3.ts:662-664).
listener 정리 테스트는 호출자와 scope signal만 감시해서, interaction
signal 쪽 제거 줄(:663)을 지운 변이 R2b가 107파일 995개를 모두
통과했다. 한 interaction 안에서 요청을 여러 번 보내면 요청마다
listener 하나(lifetime controller를 잡은 closure)가 interaction
마감까지 남는다.

고른 방법과 버린 대안
- 같은 테스트(tests/unit/http-execution-v3.test.ts)에
  createExecutionContext로 만든 interaction을 넘기고, 그
  cancellation.signal도 감시 목록에 넣는다.
- 끝나는 경우에 "interaction cancel"을 더한다. interaction 취소는
  호출자 abort와 같은 forwarder를 타지만 listener를 단 signal이 달라서
  따로 본다.
- 별도 테스트를 새로 만드는 안은 버렸다. 세 signal은 같은 정리 함수가
  지우므로 한 테스트에서 함께 보는 편이 규칙과 맞다.

위험·한계
- 테스트만 바꿨다. 실행기 코드는 그대로다. 실제 누수량은 재지 않는다.

검증
- desktop batch에서 확인:
  node scripts/run-vitest.ts run tests/unit/http-execution-v3.test.ts
- 변이 R2b(:663 제거)를 넣으면 세 경우 모두 "removes the listeners it
  added to the caller, interaction and scope signals after …"가
  실패해야 한다.

Refs: 1105/10-02
2026-11-05 21:58:39 +09:00
..