Skip to content

Commit 25dd386

Browse files
committed
docs(mc-testing-mock): name what a leaked replica keeps doing, not just that it ticks
The reclaim argument stopped at the ticked entity, the chunk ticket, and the player-list entry, which reads as a bounded, cheap residual. Two costs scale with the run instead: the replica's advancement listeners stay registered, so every criterion the mod fires keeps evaluating against a player nothing is watching, and its `EmbeddedChannel` accumulates outbound packets that nothing drains because no test reads them. Both follow from the connected replica this section already scopes itself to, so they belong here rather than in each skill that demonstrates an acquisition.
1 parent 854ed8c commit 25dd386

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎.ai/skills/mc-testing-mock/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ This player has `connection == null`, is NOT in the player list, but supports at
240240

241241
Scope is the connected replica. `makeMockPlayer` and directly constructed `ServerPlayer` instances are never added to the level or the player list, so they need no cleanup.
242242

243-
The framework never removes a mock player for you — `GameTestInfo#succeed()` and the batch sweep in `StructureUtils` both filter `Player` instances out of their bounds sweep. A connected replica that is not retired stays in the level, ticked for the rest of the run and holding a chunk ticket, *and* stays in the player list. An assertion that throws before a trailing cleanup call skips it entirely, so the guarantee is weakest exactly when the suite is unhealthy and the output is hardest to read.
243+
The framework never removes a mock player for you — `GameTestInfo#succeed()` and the batch sweep in `StructureUtils` both filter `Player` instances out of their bounds sweep. A connected replica that is not retired stays in the level, ticked for the rest of the run and holding a chunk ticket, *and* stays in the player list. Two costs ride along with that tick: its advancement listeners stay registered, so every criterion the mod fires keeps evaluating against a player no test is watching, and its `EmbeddedChannel` accumulates every broadcast the server sends it — a channel a test never reads is a channel nothing drains. An assertion that throws before a trailing cleanup call skips it entirely, so the guarantee is weakest exactly when the suite is unhealthy and the output is hardest to read.
244244

245245
Retire in a `finally`, so cleanup survives a failing assertion:
246246

0 commit comments

Comments
 (0)