Merge pull request 'test(ci): 그룹 kill 시험이 손자가 생긴 뒤에 시한을 터뜨린다' (#61) from donghyeon.kang/test/provider-group-kill-trigger into main
frontend-quality-gates / merge / static checks (push) Waiting to run
frontend-quality-gates / merge / tests (push) Waiting to run
frontend-quality-gates / merge / browser tests (push) Waiting to run
frontend-quality-gates / FE-GATE-014 / config-compatibility (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-028 / manual-accessibility-review (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-026 / lab-performance (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-015 / immutable-release-candidate (push) Blocked by required conditions
frontend-quality-gates / external-vulnerability-provider (push) Blocked by required conditions
frontend-quality-gates / external-provenance-provider (push) Blocked by required conditions
frontend-quality-gates / promote-verified-immutable-candidate (push) Blocked by required conditions
frontend-quality-gates / deploy-promoted-release (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-019 / hosting-header (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-021 / runbook-boot-config (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-022 / runbook-chunk-mismatch (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-023 / runbook-api-degradation (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-024 / runbook-telemetry (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-025 / runbook-release-rollback (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-018 / field-web-vitals (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-017 / diagram-review (push) Waiting to run
frontend-quality-gates / main / self-tests and removal drills (push) Waiting to run
frontend-quality-gates / merge / static checks (push) Waiting to run
frontend-quality-gates / merge / tests (push) Waiting to run
frontend-quality-gates / merge / browser tests (push) Waiting to run
frontend-quality-gates / FE-GATE-014 / config-compatibility (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-028 / manual-accessibility-review (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-026 / lab-performance (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-015 / immutable-release-candidate (push) Blocked by required conditions
frontend-quality-gates / external-vulnerability-provider (push) Blocked by required conditions
frontend-quality-gates / external-provenance-provider (push) Blocked by required conditions
frontend-quality-gates / promote-verified-immutable-candidate (push) Blocked by required conditions
frontend-quality-gates / deploy-promoted-release (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-019 / hosting-header (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-021 / runbook-boot-config (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-022 / runbook-chunk-mismatch (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-023 / runbook-api-degradation (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-024 / runbook-telemetry (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-025 / runbook-release-rollback (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-018 / field-web-vitals (push) Blocked by required conditions
frontend-quality-gates / FE-GATE-017 / diagram-review (push) Waiting to run
frontend-quality-gates / main / self-tests and removal drills (push) Waiting to run
This commit was merged in pull request #61.
This commit is contained in:
@@ -38,6 +38,7 @@ Gitea runner에서 merge 단계를 초록으로 만들고, worker를 늘리지
|
||||
| --- | --- | --- |
|
||||
| 흔들린 시험 기록 `docs/ledger/flaky-tests.jsonl`을 둔다(칸은 `docs/ledger/README.md` 「흔들림 기록」). 복사한 프로젝트는 줄을 비우고 받고, `.gitattributes`의 `merge=union` 한 줄도 받는다. 리뷰 기준이 벽시계 상한·시작 순서 단언을 구조적 위험으로 본다 | `docs/ledger/`, `.gitattributes`, `README.md`, `docs/work/reference/review-criteria.md`, `docs/work/reference/gates.md`, `docs/work/reference/testing.md` | `fe9990b4` |
|
||||
| `fixture-node-modules` 시험이 「CI 아님」 설치를 `CI=false`로 흉내 낸다. runner의 벤더 변수(`GITEA_ACTIONS` 등) 때문에 FE-GATE-005·020이 runner에서만 실패했다 | `tests/unit/fixture-node-modules.test.ts` | `ddfcb6f6` |
|
||||
| provider 그룹 kill 시험이 실제 250 ms 시한 대신, 손자가 pid를 쓴 뒤에 시한을 터뜨리고 손자가 사라질 때까지 기다린다. 부하가 있는 runner에서 시한이 손자보다 먼저 와 `ENOENT`로 떨어졌다 | `tests/system/ci-runner/provider-process-group.test.ts` | `9adb6125` |
|
||||
| `scripts/verify.sh parts`가 게이트 명령의 `args`를 넘긴다 | `scripts/verify.sh`, `scripts/tests/test_verify.py` | `79a225b6` |
|
||||
| `check:browser-file-storage-boundaries`가 fixture마다 eslint를 띄우지 않고 ESLint API 한 번으로 같은 판정을 한다 | `scripts/check-browser-file-storage-boundaries.ts` | `0d8e4f5a` |
|
||||
| FE-GATE-020 드릴이 한 복사본에서 같은 시험 파일을 두 번 돌지 않는다: scaffold 드릴은 `test:coverage`가 도는 plain suite를 빼고, feature-removal은 `test:all` 대신 `test:coverage` 밖에 남는 suite만 더 돈다 | `scripts/lib/feature-scaffold-drill.ts`, `scripts/test-sample-removal.ts`, `tests/unit/removal-drill-test-paths.test.ts` | `b4210753` |
|
||||
|
||||
@@ -8,3 +8,4 @@
|
||||
{"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-13", "test": "tests/system/ci-runner/provider-process-group.test.ts:11", "category": "fixed-time", "first_run": "309", "verdict": "runner run 309(#57 head, FE-GATE-013)에서 1회 실패(ENOENT descendant.pid). 시험이 runProviderProcess에 실제 250 ms 시한을 주고 그 안에 provider가 손자를 띄우고 pid를 쓴다고 가정했다. provider 시작을 400 ms 늦춘 탐침으로 결정적 재현(1/1 ENOENT), 고친 시험은 같은 탐침에서 통과. 고친 트리에서 desktop 시스템 컨테이너 20회 중 실패 0(부하 8.3~9.8, 12코어)", "quarantined_until": "", "fixed_by": "프론트 #61"}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { mkdtemp, rm } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
|
||||
@@ -21,22 +22,79 @@ describe("CI-runner provider process-group lifecycle", { timeout: childProcessTi
|
||||
"setInterval(() => {}, 1000);",
|
||||
].join("\n");
|
||||
|
||||
const running = runProviderProcess({
|
||||
executable: process.execPath,
|
||||
arguments: ["-e", source],
|
||||
environment: {
|
||||
PATH: process.env.PATH,
|
||||
DESCENDANT_PID_PATH: descendantPidPath,
|
||||
// 2026-11-13. A real 250 ms timer started the kill before a loaded runner
|
||||
// had started the descendant, so its pid file did not exist (ENOENT,
|
||||
// runner run 309). The subject is the group kill, not how long a
|
||||
// provider may run: the runner's timer fires once the descendant exists,
|
||||
// or after the watchdog, and then the missing pid fails the test.
|
||||
const startedAt = Date.now();
|
||||
const running = runProviderProcess(
|
||||
{
|
||||
executable: process.execPath,
|
||||
arguments: ["-e", source],
|
||||
environment: {
|
||||
PATH: process.env.PATH,
|
||||
DESCENDANT_PID_PATH: descendantPidPath,
|
||||
},
|
||||
timeoutMs: 250,
|
||||
},
|
||||
timeoutMs: 250,
|
||||
});
|
||||
{
|
||||
setTimer: (fire) => {
|
||||
const poll = setInterval(() => {
|
||||
const waiting = readPid(descendantPidPath) === undefined;
|
||||
if (waiting && Date.now() - startedAt <= PROCESS_WATCHDOG_MS) return;
|
||||
clearInterval(poll);
|
||||
fire();
|
||||
}, POLL_MS);
|
||||
return poll;
|
||||
},
|
||||
clearTimer: (timer) => clearInterval(timer),
|
||||
},
|
||||
);
|
||||
|
||||
await expect(running).rejects.toThrow(/timed out.*process close/u);
|
||||
const descendantPid = Number(await readFile(descendantPidPath, "utf8"));
|
||||
expect(Number.isSafeInteger(descendantPid) && descendantPid > 0).toBe(true);
|
||||
expect(() => process.kill(descendantPid, 0)).toThrow(/ESRCH|no such process/u);
|
||||
const descendantPid = readPid(descendantPidPath);
|
||||
expect(descendantPid).toBeDefined();
|
||||
await expect(waitForProcessGone(descendantPid!)).resolves.toBe(true);
|
||||
} finally {
|
||||
await rm(root, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
const POLL_MS = 10;
|
||||
/**
|
||||
* Test watchdog only, not a provider deadline: how long the test waits for the
|
||||
* descendant to write its pid, and for it to be gone after the group kill.
|
||||
* SIGKILL and the reaper (the container's init, once the provider is gone)
|
||||
* finish after the provider's close event, so the descendant is polled until
|
||||
* it is gone instead of checked once.
|
||||
*/
|
||||
const PROCESS_WATCHDOG_MS = 5_000;
|
||||
|
||||
/** The pid the provider wrote, or undefined while the file is missing or partly written. */
|
||||
function readPid(file: string): number | undefined {
|
||||
let text: string;
|
||||
try {
|
||||
text = readFileSync(file, "utf8");
|
||||
} catch (error) {
|
||||
if (error && typeof error === "object" && "code" in error && error.code === "ENOENT") return undefined;
|
||||
throw error;
|
||||
}
|
||||
const pid = Number(text);
|
||||
return /^[1-9][0-9]*$/u.test(text) && Number.isSafeInteger(pid) ? pid : undefined;
|
||||
}
|
||||
|
||||
async function waitForProcessGone(pid: number): Promise<boolean> {
|
||||
const deadline = Date.now() + PROCESS_WATCHDOG_MS;
|
||||
while (Date.now() <= deadline) {
|
||||
try {
|
||||
process.kill(pid, 0);
|
||||
} catch (error) {
|
||||
if (error && typeof error === "object" && "code" in error && error.code === "ESRCH") return true;
|
||||
throw error;
|
||||
}
|
||||
await new Promise<void>((resolve) => setTimeout(resolve, POLL_MS));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user