Repository navigation
Fix flaky game test caused by shared tank login sync - #1287
Merged
Merged
Conversation
WorldSharedTankCache#onLoggedIn sent update packets to every joining player, which throws for players without the EvilCraft channel, such as game test mock players. This made game tests using mock server players fail whenever an earlier test had created a shared tank. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ERjcy5vTk2HjkUTCDMziFA
Coverage Report for CI Build 38847405455Warning No base build found for commit Coverage: 40.396%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats💛 - Coveralls |
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.
Fixes the random failure of
gametestsbiomeextract_testbiomeextractthrowwithtrackingplayerseen in https://github.com/CyclopsMC/EvilCraft/actions/runs/38844811486/job/116792809306.Cause
WorldSharedTankCache#onLoggedInsends anUpdateWorldSharedTankClientCachePacketper shared tank to every joining player. Game test mock players (makeMockServerPlayerInLevel) have no EvilCraft channel, so NeoForge throwsUnsupportedOperationException: Payload evilcraft:update_world_shared_tank_client_cache may not be sent to the client!.This only happens when the shared tank storage is non-empty, i.e. when an entangled chalice test happened to run earlier. Test order varies, so any test using a mock server player could fail randomly.
Fix
Catch
UnsupportedOperationExceptionaround the login sync, matching the existing handling inWorldSharedTankCache#onTickandEntityBiomeExtract#updateChunkAfterBiomeChange.Test
Added
testEntangledChaliceLoginWithoutChannel, which creates a shared tank and then a mock server player. Without the fix it fails deterministically; with it, all 104 game tests pass, and./gradlew buildpasses.🤖 Generated with Claude Code
https://claude.ai/code/session_01ERjcy5vTk2HjkUTCDMziFA
Generated by Claude Code