Skip to content

Add repeated-restart resilience e2e test (issue #90 guard)#111

Merged
vchelaru merged 3 commits into
mainfrom
test/90-restart-resilience-e2e
Jul 1, 2026
Merged

Add repeated-restart resilience e2e test (issue #90 guard)#111
vchelaru merged 3 commits into
mainfrom
test/90-restart-resilience-e2e

Conversation

@vchelaru

@vchelaru vchelaru commented Jul 1, 2026

Copy link
Copy Markdown
Owner

What

Three related additions on top of the Phase-1 e2e harness (PR #110 / issue #97):

  1. Restart-resilience e2e test (issue Game loop starves Blazor UI on touch after Run #90 guard) — RepeatedRestart_UnchangedSource_StaysAliveAndKeepsWebGl.
  2. e2e-testing skill — signposts how to author these tests (born from Apos.Shapes should use KNI effect XNBs #1).
  3. CLAUDE.md guidance — proactively suggest new/updated skills, with a high bar.

1. The test

Boots the published WASM app under headless Chromium + SwiftShader, runs the default sample, then clicks Restart 20 times with unchanged source, asserting after each that the Blazor circuit is alive (#blazor-error-ui hidden) and the WebGL context is re-established (window._canvasContextType comes back set).

Why meaningful: each Restart rebuilds the whole Game/GraphicsDevice; 20 iterations exceeds Chrome's ~16 live-context cap, so a regression of the UseReferenceDevice leak fix would trip context loss around run ~16 and fail here. Also exercises the per-run cleanup path (RunAllCleanups, Window.Current delegate reset) that #90 hardened.

Sync without app changes: LaunchGameFromTypeAsync writes window._canvasContextType at the end of every successful run. The test nulls it before each click and waits for the app to re-set it — a deterministic per-restart completion signal. This is why #90 needs no app hook (unlike the upcoming #95 sample-switch guard, which will add a debug input hook).

Extracted shared BootAsync / ClickRunAsync / WaitForWebGlContextAsync / AssertNoBlazorErrorAsync helpers so both tests share one WASM boot. No CI edit — dotnet test auto-discovers the new test.

2. e2e-testing skill

.claude/skills/e2e-testing/SKILL.md — the reusable "20%": the publish→in-process-Kestrel→headless-Chromium flow, SwiftShader args, the observable JS/DOM signal catalogue and what each proves, the null-and-wait pattern, and the "reserve app-code hooks for input assertions (#95)" boundary. Verified against source.

3. CLAUDE.md skill-suggestion guidance

Adds a rule to proactively suggest a new/updated skill when reusable subsystem knowledge is re-derived — but only high-confidence cases, since every skill line costs tokens on every load. Errs toward not proposing.

Verification

Both e2e tests pass locally (~21s total, incl. the 20-restart loop) against SwiftShader software GL.

Regression guard for #90 (already closed) — does not re-close it.

🤖 Generated with Claude Code

vchelaru and others added 3 commits July 1, 2026 04:45
Guards the #90 restart fixes: click Restart 20 times with unchanged
source and assert the Blazor circuit stays alive (no #blazor-error-ui)
and the WebGL context is re-established each run. 20 restarts exceeds
Chrome's ~16 live-context cap, so a regression of the UseReferenceDevice
leak fix would trip context loss and fail here.

Each iteration nulls window._canvasContextType and waits for the running
game to re-set it (DoCompileAndRun writes it at the end of every run) —
a deterministic, app-code-free per-restart completion signal.

Shared boot/click/wait helpers extracted from the existing smoke test so
both tests share one WASM boot.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signposts how to author Playwright .NET e2e tests for the WASM app: the
publish→in-process-Kestrel→headless-Chromium harness, SwiftShader GL
args, the observable JS/DOM signals a test can synchronize on, and the
null-and-wait per-run sync pattern. Born from the #90 restart test; the
next consumer is the #95 sample-switch guard.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Close the gap where noticing reusable knowledge that warrants a new
skill fell to the user: after finishing work, proactively suggest a
new/updated skill — but only high-confidence cases, since skill lines
cost tokens on every load. Err toward not proposing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vchelaru
vchelaru merged commit e5b837a into main Jul 1, 2026
1 check passed
@vchelaru
vchelaru deleted the test/90-restart-resilience-e2e branch July 1, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant