From 8d328c9ceab12878d371c4d3d93a97618a4f606b Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Wed, 4 Nov 2026 20:34:22 +0900 Subject: [PATCH] =?UTF-8?q?test(indexeddb):=20=EC=B0=A8=EB=8B=A8=20?= =?UTF-8?q?=EC=97=85=EA=B7=B8=EB=A0=88=EC=9D=B4=EB=93=9C=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=EA=B0=80=20500=20ms=20=EC=A0=84=EC=9D=B4=20?= =?UTF-8?q?=EC=83=81=ED=83=9C=EB=A5=BC=20=ED=8F=B4=EB=A7=81=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제 tests/browser-capabilities/indexeddb-runtime.spec.ts의 차단 업그레이드 테스트는 v2 runtime을 blockedTimeoutMs 500으로 시작한 뒤 expect.poll(lifecycleStatus)로 BLOCKED 상태를 기다린다. 이 상태는 500 ms 뒤 CLOSED/NOT_OPENED로 바뀌고, 폴링 한 번은 page.evaluate 왕복이다. 그래서 바쁜 호스트에서는 첫 관찰 전에 창이 닫혀 FE-GATE-008이 코드와 무관하게 떨어진다(리뷰 전체 실행에서 chromium·webkit 실패). 고른 방법 - 전이 상태 폴링을 지우고, 바로 뒤 settleLifecycleRuntime 결과 (opened.error.code BLOCKED, recovery RELOAD_OTHER_CONTEXTS, status CLOSED/NOT_OPENED)로 차단을 판정한다. 전이 상태 BLOCKED는 제어한 scheduler로 tests/unit/indexeddb-runtime.test.ts가 이미 고정한다. - 버린 대안: blockedTimeoutMs를 늘리기. 창이 넓어질 뿐 경쟁이 남는다. runtime이 상태 변화를 기록하게 하기. 운영 코드에 테스트용 기록이 생긴다. 위험·한계 - 실제 브라우저에서 getStatus()가 BLOCKED를 돌려주는 순간은 이 spec이 더는 보지 않는다(단위 테스트가 본다). 검증 - RED: 창을 20 ms로 줄이면 수정 전 테스트가 chromium·webkit에서 CLOSED/NOT_OPENED를 받아 실패했다(리뷰 실패와 같은 모양). 수정 뒤 같은 20 ms에서 세 엔진 통과. 값은 500으로 되돌렸다. - test:browser-capabilities 전체 63 passed(load 15~20). 5회 반복은 하지 않았다. Refs: docs/reviews/2026-11-03-maturity-review/11-tests-browser-release-scale.md 11-05 --- .../browser-capabilities/indexeddb-runtime.spec.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tests/browser-capabilities/indexeddb-runtime.spec.ts b/tests/browser-capabilities/indexeddb-runtime.spec.ts index e3fa690b..c02a959f 100644 --- a/tests/browser-capabilities/indexeddb-runtime.spec.ts +++ b/tests/browser-capabilities/indexeddb-runtime.spec.ts @@ -1020,15 +1020,12 @@ test("fails a blocked v2 upgrade closed, then closes its late connection after t ); expect(blocker).toBe("OPEN"); + // 1103/11-05. The BLOCKED status lasts only blockedTimeoutMs before the + // runtime closes, and each poll is a page.evaluate round trip, so a loaded + // host saw CLOSED first. The settled open result below already says the + // upgrade was blocked; tests/unit/indexeddb-runtime.test.ts pins the + // transient status on a controlled clock. await startLifecycleRuntime(page, name, 2, 500); - await expect - .poll(async () => await lifecycleStatus(page)) - .toEqual({ - kind: "BLOCKED", - currentVersion: 1, - targetVersion: 2, - }); - const blocked = await settleLifecycleRuntime(page); expect(blocked).toMatchObject({ opened: {