From 86569da2becfa15549c23b52c968b500969c8233 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Sat, 14 Nov 2026 03:41:27 +0900 Subject: [PATCH] =?UTF-8?q?test(ci):=20=EA=B3=B5=EA=B8=89=EC=9E=90=20?= =?UTF-8?q?=EC=8B=9C=ED=97=98=EC=9D=B4=20=EA=B0=90=EB=8F=85=20=EC=8B=9C?= =?UTF-8?q?=ED=95=9C=20=ED=8C=90=EC=A0=95=EC=9D=84=20=EB=B2=BD=EC=8B=9C?= =?UTF-8?q?=EA=B3=84=20=EB=8C=80=EC=8B=A0=20=EA=B2=B0=EA=B3=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=8B=A8=EC=96=B8=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tests/system/ci-runner/ci-artifact-contract.test.ts의 「applies effective aggregate cgroup limits」는 공급자(1.5초 쉼)가 4초 감독 시한 전에 스스로 끝났는지를 `Date.now() - completionStarted < 4000`으로 봤다. 이 벽시계는 감독이 끝난 뒤 trace 읽기와 단언에 걸린 시간까지 잰다. runner run 294 (FE-GATE-013, 이 파일을 안 건드린 #55의 run)에서 4271로 실패했는데, 같은 run에서 바로 앞의 `result.code === 0`은 통과했다. 감독의 시한 경로는 늘 "sandboxed external provider command timed out"을 던지고 실패로 끝난다(scripts/run-and-validate-provider.ts waitForProvider). 그 반대쪽은 「kills descendants and collects the scope」 timeout 경우가 시험한다. 그래서 exit 0과 `timed out` 없음이 시한에 안 죽었다는 결정적 증거다. 벽시계 상한을 지우고 그 자리에 `not.toMatch(/timed out/)`와 근거 주석을 둔다. 같은 모양을 tests/system 전체에서 찾았다(벽시계 상한 단언). 「enforces CPU RLIMIT before the independent wall-clock timeout」의 `< 5000`이 하나 더 있다. 감독 자신의 시작과 정리까지 재고, 시한 판정은 이미 `not.toMatch(/timed out/)`가 한다. 이것도 지운다. 버린 대안: - 상한을 4초보다 늘리기: 무엇을 지키는지 그대로 모호하고 부하에서 다시 흔들린다(design-docs ci/manual.md 8.4절). - 감독이 끝난 시각을 바로 재기: 감독 프로세스 시작(시한 타이머 밖)이 여전히 들어간다. 결과로 판정하면 시간이 필요 없다. 위험·한계: - 감독 시작·정리가 느려지는 회귀는 이 시험이 더는 잡지 않는다. 시간 측정은 performance lane 몫이다. - 고정 시간 가정은 남는다. 공급자의 1.5초 창 안에 unit 속성을 읽는 것, rlimit 시험의 spawn 시한 7초(hang 막이, 감독 시한 5초보다 커서 시한이 터지면 `timed out`이 먼저 보인다). 관측된 실패는 없어 그대로 둔다. - 흔들림 장부(docs/ledger/flaky-tests.jsonl)에 이 흔들림 한 줄과, 반복 실행에서 본 다른 흔들림 한 줄(아래)을 더한다. 예측 장부에 착수 예측 한 줄을 더한다. - 반복 실행에서 이 변경과 다른 원인의 흔들림을 봤다. 파일 전체 실행 중 79번째 provider 시험부터 18개가 연달아 `exit=125`로 실패한다(11-13 main c5f29344에서도 한 번). 125를 내는 쪽(cgroup 강제 게이트, scope wrapper)의 stderr를 waitForProvider가 버려 원인을 모른다. 장부에 fixed_by 없이 적고 고치지 않았다. 검증(desktop 시스템 컨테이너): - RED: main에 「완료 직후 2.6초 쉼」 탐침을 넣으면 감독은 2574 ms에 exit 0, `timed out` 없이 끝났는데 옛 단언이 5180 ms로 실패했다. - 변이: 감독 시한을 1000으로 줄이면 새 단언이 실패한다. - 이 파일 전체를 8회 돌려 6회 110/110 통과. 나머지 2회는 위의 exit=125 묶음(18개)이고, 바꾼 두 시험은 그 묶음에 들어 125로 실패했다. 묶음 밖 6회에서는 모두 통과했다. --- docs/ledger/estimates.jsonl | 1 + docs/ledger/flaky-tests.jsonl | 2 ++ .../system/ci-runner/ci-artifact-contract.test.ts | 14 ++++++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/ledger/estimates.jsonl b/docs/ledger/estimates.jsonl index 090116c7..dec1bb27 100644 --- a/docs/ledger/estimates.jsonl +++ b/docs/ledger/estimates.jsonl @@ -6,3 +6,4 @@ {"schema": 1, "kind": "actual", "task": "w2-fe-ci-perf", "recorded_at": "2026-11-12T22:25+09:00", "transcript": "00d79702-1dea-4e11-b79a-f021d0d9f4bb", "minutes": 1463, "active_minutes": 308, "calls": 447, "output_tokens": 413297, "cache_read_tokens": 246773496, "max_context": 943246, "within": "p30", "result": "partial", "commits": ["ddfcb6f6", "79a225b6", "0d8e4f5a", "b4210753", "66138440", "1d3eb901", "92abfd20", "1f09c1cc", "27876ffc", "35b60a04", "f90ffb6c", "f6e2560e", "ba72b865"], "why": "작업 중 시간은 p30 안이지만 일이 끝나지 않고 인계됐다(PR #19 Draft). 벽시계의 대부분은 runner 대기열(백엔드 정기 lane 뒤)과 desktop heavy 잠금 대기다. 남은 것: runner 초록 확인, concurrency, firefox 흔들림, coverage 경로, 느린 시험 둘. 세션 기록으로 다시 셌고 인계 절을 쓴 22:10 KST 뒤까지 들어 있다. 기록은 이어받은 세션이 남긴다"} {"schema": 1, "kind": "estimate", "task": "w2-fe2-takeover", "recorded_at": "2026-11-12T22:25+09:00", "transcript": "fa9a12aa-7abc-46ca-a5fd-ee00cab98618", "started_at": "2026-11-12T21:05+09:00", "base": "ba72b865", "task_kind": "improve+operate", "size": "large", "minutes": {"p30": 180, "p50": 300, "p80": 480}, "calls": {"p30": 250, "p50": 400, "p80": 650}, "output_tokens": {"p30": 150000, "p50": 250000, "p80": 400000}, "basis": "PR #19 이어받기(인계 절 2026-11-12 22:10). concurrency·coverage 경로·느린 시험 둘은 각 30~60분(작음, 선례 W2-BE concurrency). firefox 008 흔들림은 원인 미확정이라 1~4시간. runner 1대를 백엔드와 같이 써 PR run 하나가 대기 포함 1시간 이상(W2-BE 기록: PR run이 2~4시간 뒤로 밀림), 초록 3회와 실패-고침 1~2번을 p80에 넣었다. 첫 5분 뒤에 적었다(인계 대기 중 시작)"} {"schema": 1, "kind": "estimate", "task": "r9-fe-group-A", "recorded_at": "2026-11-13T18:50+09:00", "transcript": "66f9f89d-a13f-4cee-a2bf-c3c528c6bfb2", "started_at": "2026-11-13T17:57+09:00", "base": "ee95573f", "task_kind": "improve", "size": "large", "minutes": {"p30": 300, "p50": 420, "p80": 600}, "calls": {"p30": 350, "p50": 500, "p80": 750}, "output_tokens": {"p30": 200000, "p50": 300000, "p80": 450000}, "basis": "round9 그룹 A 발견 22건(화면·토큰·story·검사·접근성 기록)을 PR 셋으로. 바꿀 파일 약 60개, CSS 선언 118개 토큰화와 story 37개가 가장 크다. desktop heavy 잠금을 다른 세션 넷과 같이 써 실행마다 대기 10~30분, merge 단계 셋(각 약 21분)과 골든 갱신·변이 실험, runner run 셋(각 약 23분)을 p80에 넣었다. 선례 r9-fe F4a·F5(묶음당 2~4시간). 착수 약 50분 뒤 발견 원문을 다 읽고 PR1 고침을 쓰던 중에 적었다"} +{"schema": 1, "kind": "estimate", "task": "fe-ci-fix2", "recorded_at": "2026-11-14T03:16+09:00", "transcript": "daafc8d5-d94b-4404-b2c1-adb2b69d1741", "started_at": "2026-11-14T03:03+09:00", "base": "cfb32a66", "task_kind": "improve", "size": "small", "minutes": {"p30": 90, "p50": 150, "p80": 240}, "calls": {"p30": 120, "p50": 180, "p80": 280}, "output_tokens": {"p30": 50000, "p50": 90000, "p80": 150000}, "basis": "프론트 CI 작은 수정 둘(#54 fixture env, main 시간 단언)과 #55 main 갱신. 고칠 파일 각 1~4개, 원인은 로그로 이미 좁혀짐(선례 w2-fe2 http deadline 가짜 시계 30~60분). 벽시계 대부분은 desktop heavy 잠금(merge 단계 약 25분, system 시험 반복 5회)과 runner run 셋(각 약 25분, 1대 공유 대기)이다. 실패-고침 한 번을 p80에 넣었다. 착수 약 13분 뒤, 첫 RED를 본 뒤에 적었다"} diff --git a/docs/ledger/flaky-tests.jsonl b/docs/ledger/flaky-tests.jsonl index 20df1280..77c6e3c9 100644 --- a/docs/ledger/flaky-tests.jsonl +++ b/docs/ledger/flaky-tests.jsonl @@ -8,3 +8,5 @@ {"date": "2026-11-13", "test": "tests/browser-capabilities/indexeddb-runtime.spec.ts:256", "category": "resource-io", "first_run": "/tmp/claude-gates/ci-pr-gate-selection-merge/gate-artifacts/FE-GATE-008.txt", "verdict": "[firefox] desktop merge(트리 148e68f4, #47 없음)에서 30초 timeout 1회. 같은 게이트가 Firefox 프로필을 RAM에 둔 #47 트리에서는 69개 전부 통과. Firefox IndexedDB·OPFS가 프로필 디스크를 기다린 것으로 봄", "quarantined_until": "", "fixed_by": "프론트 #47"} {"date": "2026-11-13", "test": "tests/browser-capabilities/local-draft-composition.spec.ts:10", "category": "resource-io", "first_run": "/tmp/claude-gates/ci-pr-gate-selection-merge/gate-artifacts/FE-GATE-008.txt", "verdict": "[firefox] desktop merge(트리 148e68f4, #47 없음)에서 30초 timeout 1회. 같은 게이트가 Firefox 프로필을 RAM에 둔 #47 트리에서는 69개 전부 통과. Firefox IndexedDB·OPFS가 프로필 디스크를 기다린 것으로 봄", "quarantined_until": "", "fixed_by": "프론트 #47"} {"date": "2026-11-13", "test": "tests/browser-capabilities/opfs-runtime.spec.ts:338", "category": "resource-io", "first_run": "/tmp/claude-gates/ci-pr-gate-selection-merge/gate-artifacts/FE-GATE-008.txt", "verdict": "[firefox] desktop merge(트리 148e68f4, #47 없음)에서 30초 timeout 1회. 같은 게이트가 Firefox 프로필을 RAM에 둔 #47 트리에서는 69개 전부 통과. Firefox IndexedDB·OPFS가 프로필 디스크를 기다린 것으로 봄", "quarantined_until": "", "fixed_by": "프론트 #47"} +{"date": "2026-11-14", "test": "tests/system/ci-runner/ci-artifact-contract.test.ts:892", "category": "fixed-time", "first_run": "294", "verdict": "runner 1회 실패(FE-GATE-013, 4271 ms, 상한 4000). 단언은 공급자가 4초 감독 시한 전에 스스로 끝났는지가 아니라 완료 뒤 trace 확인까지의 벽시계를 쟀다. desktop 탐침에서 감독은 2574 ms에 exit 0·timed out 없이 끝났는데 완료 뒤 2.6초를 두자 같은 줄이 5180 ms로 실패(결정적). 같은 모양 :1105(CPU rlimit 시험의 5초 상한)도 고침", "quarantined_until": "", "fixed_by": "프론트 #57"} +{"date": "2026-11-13", "test": "tests/system/ci-runner/ci-artifact-contract.test.ts:671", "category": "resource-io", "first_run": "/tmp/claude-gates/w2fe2-t08m/sys-2.json", "verdict": "desktop 시스템 컨테이너에서 이 파일 전체 실행 중 79번째 「leaves no stale raw report after invalid trust」부터 provider 시험 18개가 연달아 `sandboxed external provider failed: exit=125`로 실패. 11-13 main c5f29344 3회 중 1회, 11-14 트리 a34dd34d 8회 중 2회(fe-b-green1·4). 부하와 상관 없어 보이고 runner에서는 아직 안 봄. 125는 cgroup 강제 게이트(scripts/lib/provider-cgroup.ts)나 scope wrapper가 내는데, waitForProvider가 그 stderr를 버려 원인 미확정. 범주는 가정", "quarantined_until": "", "fixed_by": ""} diff --git a/tests/system/ci-runner/ci-artifact-contract.test.ts b/tests/system/ci-runner/ci-artifact-contract.test.ts index 64f66cfa..5dd29415 100644 --- a/tests/system/ci-runner/ci-artifact-contract.test.ts +++ b/tests/system/ci-runner/ci-artifact-contract.test.ts @@ -822,7 +822,6 @@ describe("candidate archive and provider upload boundaries", { timeout: childPro VULNERABILITY_PROVIDER_SECRET: credential, }, }); - const completionStarted = Date.now(); const supervisorPid = execution.child.pid!; const unit = await waitForProviderUnit("vulnerability", supervisorPid); const properties = showProviderUnit(unit); @@ -844,7 +843,14 @@ describe("candidate archive and provider upload boundaries", { timeout: childPro expect(readProviderUnitMetadata(unit)).not.toMatch(new RegExp(`${command}|${credential}`, "u")); const reportIdentity = await lstat(fixture.reportPath); const result = await execution.completion; + // The provider ended on its own, before the 4 s supervisor deadline: the + // deadline path always fails the run with "timed out" + // (scripts/run-and-validate-provider.ts waitForProvider; the timeout case + // of "kills descendants and collects the scope" shows it). This replaces a + // wall-clock bound that also timed the trace checks after completion and + // failed at 4271 ms on a run that had not timed out (runner run 294). expect(result.code, result.stderr).toBe(0); + expect(result.stderr).not.toMatch(/timed out/iu); expect(result.stdout).not.toContain(credential); expect(result.stderr).not.toContain(credential); @@ -889,7 +895,6 @@ describe("candidate archive and provider upload boundaries", { timeout: childPro expect(recordedArguments).not.toContain(command); expect(recordedArguments).not.toContain(providerScript); expect(recordedArguments).not.toContain(credential); - expect(Date.now() - completionStarted).toBeLessThan(4_000); await expectProviderUnitGone(unit); await expect(lstat(cgroupRoot)).rejects.toMatchObject({ code: "ENOENT" }); expect(trace.every((entry) => !processExists(entry.pid))).toBe(true); @@ -1095,14 +1100,15 @@ describe("candidate archive and provider upload boundaries", { timeout: childPro it("enforces CPU RLIMIT before the independent wall-clock timeout", async () => { const fixture = await createProviderFixture(); await rm(fixture.reportPath); - const started = Date.now(); const result = runProviderSupervisor(fixture, { command: "node -e 'while(true){}'", sealedPath: path.join(fixture.root, "provider-evidence/vulnerability-report.json"), environment: { PROVIDER_SUPERVISOR_CPU_SECONDS: "1", PROVIDER_SUPERVISOR_TIMEOUT_MS: "5000" }, spawnTimeoutMs: 7_000, }); - expect(Date.now() - started).toBeLessThan(5_000); + // The rlimit ended it, not the 5 s deadline: the deadline path says "timed + // out" (checked below). No wall-clock bound: it also timed the supervisor's + // own start and reap, which lie outside that deadline. expect(result.status).not.toBe(0); expect(result.stderr).toMatch(/exit=(?:137|152)|signal=SIG(?:XCPU|KILL)/iu); expect(result.stderr).not.toMatch(/timed out/iu);