Repository navigation
test(admin-panel): fix flaky logging configuration page tests - #1247
Merged
Merged
Conversation
…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
Deploying openmudocs with
|
| Latest commit: |
7d02f9c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6005f34a.openmudocs.pages.dev |
| Branch Preview URL: | https://claude-admin-dashboard-mocku.openmudocs.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
LoggingConfigurationPageTests.DoesNotSaveInvalidJsonfailed intermittently, e.g. on the CI run of #1246:Why it failed
The page loads its configuration file asynchronously.
WaitForStatereturns 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 afterClick()/Change()returned, so the nextFindlooked 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.
SavesChangedLevelsfailed in the same repeated run withUnknownEventHandlerIdException(it clicked a button of the previous render), andDoesNotSaveOverrideWithoutSourceverified 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
[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