Skip to content

test(admin-panel): fix flaky logging configuration page tests - #1247

Merged
sven-n merged 1 commit into
masterfrom
claude/admin-dashboard-mockup-iyw0fv
Oct 18, 2026
Merged

sven-n merged 1 commit into
masterfrom
claude/admin-dashboard-mockup-iyw0fv

Conversation

@sven-n

@sven-n sven-n commented Oct 18, 2026

Copy link
Copy Markdown
Member

What

LoggingConfigurationPageTests.DoesNotSaveInvalidJson failed intermittently, e.g. on the CI run of #1246:

Bunit.ElementNotFoundException : No elements were found that matches the selector 'textarea'

Why it failed

The page loads its configuration file asynchronously. WaitForState returns as soon as the loaded content appears in the markup, but at that moment the page may still be finishing its initialization. An event triggered right then is handled shortly after Click()/Change() returned, so the next Find looked at the previous render.

A probe which repeated the scenario 300 times confirmed it: in about one of ten iterations the click didn't cause a render immediately, but the textarea appeared a moment later without any further action. It happens mostly in the first run after a build (slow, cold start), which is what CI does.

The other two tests of the fixture have the same pattern. SavesChangedLevels failed in the same repeated run with UnknownEventHandlerIdException (it clicked a button of the previous render), and DoesNotSaveOverrideWithoutSource verified the toast right after the click.

Fix

The tests now wait for the result of each interaction (WaitForState/WaitForElement/WaitForAssertion) before the next step. Only the test file changes; the page is unchanged.

Testing

  • Each of the three tests ran 300 times ([Repeat(300)], not committed), twice: all passed. Before the fix, the same repeated run failed.
  • dotnet test tests/MUnique.OpenMU.Web.Tests -p:ci=true: 278 passed.

Generated by Claude Code

…g configuration page tests

The page loads its configuration file asynchronously. When a test
interacts with it right after the content appeared, the page may still
finish its initialization, so the event is handled after Click or Change
returned. The tests then found the elements of the previous render:
"No elements were found that matches the selector 'textarea'" or an
UnknownEventHandlerIdException. This happened in about one of ten runs,
mostly in the first run after a build (e.g. on CI).

The tests now wait for the result of each interaction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XowA25b3pgLghrNZSZRwTi
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying openmudocs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7d02f9c
Status: ✅  Deploy successful!
Preview URL: https://6005f34a.openmudocs.pages.dev
Branch Preview URL: https://claude-admin-dashboard-mocku.openmudocs.pages.dev

View logs

@sven-n
sven-n merged commit fd69bd7 into master Oct 18, 2026
3 checks passed
@sven-n
sven-n deleted the claude/admin-dashboard-mockup-iyw0fv branch October 18, 2026 17:30
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.

2 participants