Skip to content

fix: failing player tests in netcode.gameobjects (UUM-160259) - #4246

Open
NoelStephensUnity wants to merge 3 commits into
develop-3.x.xfrom
fix/player-test-failures-uum-160259
Open

NoelStephensUnity wants to merge 3 commits into
develop-3.x.xfrom
fix/player-test-failures-uum-160259

Conversation

@NoelStephensUnity

@NoelStephensUnity NoelStephensUnity commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Purpose of this PR

Fixes the NGO runtime tests that fail in non-development player builds, and adds a regression test for ObjectNameIdentifier registration across ownership changes. This replicates trunk PR unity/unity#137865 (shadow package), so the two copies stay in sync.

PR Scope:

  • NamedMessageTests / UnnamedMessageTests: the too-big-buffer tests are ignored when DEBUG is not defined (the message size check only exists under DEBUG).
  • UnityTransportTests.DoesNotActAfterShutdown: the "should only be called on a listening server" warning is only expected under DEBUG (UnityTransport.DisconnectRemoteClient only logs it under DEBUG).
  • New ObjectNameIdentifierTests.OwnershipChangesKeepAllInstancesRegistered: an object stays registered on every instance after ownership is given away and then removed.

Out of scope:

Jira ticket

UUM-160259

Documentation

  • No documentation changes or additions were necessary.

Testing & QA (How your changes can be verified during release Playtest)

Functional Testing

Automated tests:

  • Covered by new automated tests

Validated in trunk on the shadow package PR.

Up-port

N/A (develop-3.x.x specific)

Backports

None. Tests only.

Guard the DEBUG-only message size check and UnityTransport warning in their tests, and add a regression test that ownership changes keep every instance registered with ObjectNameIdentifier.
@NoelStephensUnity
NoelStephensUnity requested a review from a team as a code owner November 9, 2026 17:22

@u-pr u-pr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Harness Review

Ship it

The test guards match the runtime’s DEBUG-only checks, and the new test covers registration across ownership transfer and removal. I examined the matching runtime branches, registration callbacks, wait behavior, and test teardown.

Reviewed commit f75ee37

🤖 Helpful? 👍/👎

@NoelStephensUnity
NoelStephensUnity enabled auto-merge (squash) November 9, 2026 17:25
@codecov-github-com

codecov-github-com Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

@@                Coverage Diff                @@
##           develop-3.x.x    #4246      +/-   ##
=================================================
- Coverage          76.73%   76.72%   -0.02%     
=================================================
  Files                159      159              
  Lines              28101    28101              
=================================================
- Hits               21564    21560       -4     
- Misses              6537     6541       +4     
Flag Coverage Δ
NGOv2_project_testproject_ubuntu 75.76% <ø> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

Components Coverage Δ
com.unity.netcode.gameobjects 76.72% <75.00%> (-0.02%) ⬇️

ℹ️ Need help interpreting these results?

@EmandM EmandM left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good other than the tests for the test helper

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ObjectNameIdentifier is a test helper. We don't want to add tests for regressions in the test helpers. The tests being helped by the test helpers should be the regression test for those changes.

This branch has not been deployed

No deployments
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.

3 participants