test(setup): 자식 프로세스 시험 timeout을 잰 값으로 정하고 흔들리던 시험 둘을 고친다 #22
Merged
donghyeon.kang
merged 4 commits from 2026-11-12 04:13:12 +00:00
fix/child-process-test-timeouts into main
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
a593feb252 |
docs(changelog): 자식 프로세스 시험 timeout과 흔들리던 시험 둘의 고침을 적는다
frontend-quality-gates / merge / static checks (pull_request) Successful in 2m37s
frontend-quality-gates / merge / tests (pull_request) Failing after 13m15s
frontend-quality-gates / merge / browser tests (pull_request) Failing after 7m3s
frontend-quality-gates / FE-GATE-017 / diagram-review (pull_request) Skipped
frontend-quality-gates / main / checker self-tests (pull_request) Skipped
frontend-quality-gates / FE-GATE-014 / config-compatibility (pull_request) Skipped
frontend-quality-gates / FE-GATE-028 / manual-accessibility-review (pull_request) Skipped
frontend-quality-gates / FE-GATE-026 / lab-performance (pull_request) Skipped
frontend-quality-gates / FE-GATE-015 / immutable-release-candidate (pull_request) Skipped
frontend-quality-gates / external-vulnerability-provider (pull_request) Skipped
frontend-quality-gates / external-provenance-provider (pull_request) Skipped
frontend-quality-gates / promote-verified-immutable-candidate (pull_request) Skipped
frontend-quality-gates / deploy-promoted-release (pull_request) Skipped
frontend-quality-gates / FE-GATE-019 / hosting-header (pull_request) Skipped
frontend-quality-gates / FE-GATE-021 / runbook-boot-config (pull_request) Skipped
frontend-quality-gates / FE-GATE-022 / runbook-chunk-mismatch (pull_request) Skipped
frontend-quality-gates / FE-GATE-023 / runbook-api-degradation (pull_request) Skipped
frontend-quality-gates / FE-GATE-024 / runbook-telemetry (pull_request) Skipped
frontend-quality-gates / FE-GATE-025 / runbook-release-rollback (pull_request) Skipped
frontend-quality-gates / FE-GATE-018 / field-web-vitals (pull_request) Skipped
정리 단계 절에 이 브랜치의 범위를 넣었다. 먼저 할 일 17을 더했다: 기본 timeout인 Vitest 시험이 자식 프로세스를 띄우면 실패하니, 다운스트림은 자기 시험에 childProcessTimeout(<잰 ms>)을 준다. 옮긴 뒤 확인 1에는 test:integration과 17단계를 더했다. 계약 표 한 줄과, 그 밖의 수정에 guardian lease 고침과 archive 시험의 임시 파일 경합 고침을 한 줄씩 적었다. 검증(desktop): verify:documentation, test:unit. |
||
|
|
db4c632d53 |
test(archive): 다른 시험이 쓰는 중인 임시 파일은 사본에 복사하지 않는다
tests/integration/security-followup-archive.test.ts는 후보 빌드에 쓸 증거를 얻으려고 checkout의 artifacts/를 통째로 사본에 복사한다. 같은 integration 실행에서 tests/integration/http-scenario-catalog.test.ts가 artifacts/tests/http-scenario-executions.json을 임시 파일에 쓰고 rename한다. 복사가 목록을 읽은 뒤 그 임시 파일이 rename되면 ENOENT로 실패한다. desktop FE-GATE-007(2026-11-12, load 9)에서 났다. 복사 filter가 원자적 쓰기의 임시 파일(.<이름>.<무작위>.tmp)을 건너뛴다. 그런 파일은 쓰는 중이라 증거가 아니다. fs.cp는 filter를 stat보다 먼저 부르므로, 건너뛴 파일은 사라져도 오류가 없다. 버린 것: - 필요한 증거 경로만 복사: 공급망 생성이 추적 파일(artifacts의 .gitkeep 포함)을 모두 lstat하고 build가 읽는 증거가 여러 곳이라, 목록을 따로 관리해야 한다. - 두 시험을 같이 돌지 않게 하기: integration 층 전체를 직렬로 돌려야 한다. 위험: 임시 파일이 아닌 파일을 다른 시험이 지우는 경합은 남는다. 지금 artifacts/ 아래에서 그렇게 하는 시험은 찾지 못했다. 검증(desktop): - 다른 프로세스가 artifacts/tests에 임시 파일 10개를 계속 만들고 rename하는 동안 이 시험을 돌렸다. main 6b4f703c는 3회 중 2회가 같은 ENOENT(.tmp)로 실패했고, 이 커밋은 3회 모두 통과했다. - test:unit, check:types, check:ci, lint, verify:documentation. |
||
|
|
77c01b03c1 |
test(guardian): lease가 시험 대상이 아니면 시험 timeout만큼 준다
tests/integration/provider-guardian-transaction.test.ts가 부하 때 lease
만료로 실패한다. guardian이 스스로 SIGKILL한 것이다. desktop 기록 둘:
- FE-GATE-007: 「still publishes near the lease deadline」
- FE-GATE-020 drill: 「owns raw and sealed publication through the
authenticated client lease」
FE-B 실행에서도 load 28에 같은 실패가 2건 났다. 다시 돌리면 통과한다.
원인은 두 가지다.
- startProviderGuardian은 guardian을 띄우자마자 절대 deadline
(Date.now() + leaseMs)을 찍는다. 그래서 client 경로 시험의 2~3초
lease가 node 시작 시간까지 낸다. 부하 때 시작에는 상한이 없다.
- 직접 프로토콜 시험은 guardian이 load를 마친 뒤 가드를 보낸다
(
|
||
|
|
91962e24e3 |
test(setup): 자식 프로세스를 띄우는 시험이 잰 시간으로 timeout을 정한다
자식 프로세스를 띄우는 Vitest 시험 91개(24파일)가 기본 timeout 10초에 기대고 있었다. 셋은 FE-GATE-013에서만 도는 tests/system 시험이다. 기본값은 프로세스 안에서 도는 시험에 맞춘 값이다. 부하가 높은 desktop에서는 자식 프로세스 시험이 평소보다 크게 느려진다. FE-GATE-020 drill 사본에서 평소 0.4~1.2초인 문서 시험이 10.6초 걸려 실패했다(2026-11-12). 가장 위험한 것은 tests/architecture/app-build-input .test.ts로, desktop에서 이미 5.7초까지 걸렸다. 무엇을 고칠지는 desktop 계측으로 정했다. - test:coverage 묶음(maxWorkers=4)과 test:unit을 세 번씩 돌렸다. 시험마다 띄운 자식 프로세스는 child_process 함수를 감싸 기록했고, 소요 시간은 JSON reporter로 받았다. - 시험마다 실제 timeout은 task.timeout으로 기록했다. - 자식 프로세스를 띄우는 시험 140개 중 88개가 기본값이었다. tests/system은 그 묶음에 없어서, 아래 검사가 잡은 셋을 따로 세 번 쟀다. 고친 것: - tests/helpers/child-process-timeout.ts의 childProcessTimeout(<잰 최대 ms>)는 그 15배를 30초 단위로 올린 값이다. 15배는 위 0.7초 → 10.6초에서 왔다. 시험마다 자기가 잰 최대값을 인자로 적어 근거가 호출 자리에 남는다. - describe 안의 기본값 시험이 모두 자식 프로세스를 띄우면 describe에, 일부만 띄우면 그 시험에 준다. 프로세스 안에서 도는 시험의 hang을 늦게 잡지 않으려는 것이다. - tests/setup.ts가 child_process 함수를 감싼다. 기본 timeout인 시험이 자식 프로세스를 띄우면 그 호출에서 실패시키고, helper 이름을 알린다. helper나 시험이 import한 스크립트가 띄워도 잡는다. util.promisify가 읽는 속성은 원래 함수에서 옮긴다. - docs/work/reference/testing.md 2절에 값 정하는 법과 이 검사를 적었다. 버린 것: - 전역 testTimeout 올리기: 프로세스 안 시험의 hang을 늦게 잡는다. - 시험마다 손으로 정한 숫자: 근거가 남지 않고, 이미 있는 값도 60_000·120_000처럼 근거가 없었다. - 자식 프로세스를 띄우지 않게 바꾸기: 검사 스크립트를 CLI 그대로 시험하는 것이 이 시험들의 목적이라 범위가 커진다. - 파일에 timeout 선언이 있는지만 보는 정적 검사: helper가 띄우는 경우와 같은 파일의 다른 시험을 놓친다. 위험: - hook(beforeAll 등)에서 띄우는 프로세스는 검사하지 않는다. 계측에서 hook이 띄운 곳은 둘이고, 둘 다 180초를 선언했다. - 같은 파일 안에서 it.concurrent로 도는 시험이 섞이면 어느 시험의 timeout인지 틀릴 수 있다. 지금은 그런 시험이 없다. - 다운스트림 시험이 기본값으로 자식 프로세스를 띄우면 test:unit 등이 실패한다. 메시지가 helper를 알린다. 검증(desktop): - 다섯 검사(test:unit·check:types·check:ci·lint·verify:documentation) rc=0. - 자식 프로세스를 띄우는 시험 파일 40개와 tests/scale: rc=0, 검사 위반 0. - tests/system: 115개 중 18개 실패. 모두 bwrap 호스트 제약이고 검사 위반은 0이다. - 변이: 검사를 끄면 tests/unit/child-process-timeout.test.ts가 실패한다. tracked-artifacts describe의 timeout을 지우면 그 시험이 검사 메시지로 실패한다. - 재현: CPU 10% 제한에서 app-build-input·registry-governance·hosting-probe ·design-system-rules를 돌렸다. main 650d22fa는 11개가 10초 timeout으로 실패했다. 이 커밋은 71개 모두 통과했고, 가장 긴 시험은 17.7초였다. |