Repository navigation
test: generate canonical bools in NetworkVariable serialization tests - #4198
Open
NoelStephensUnity wants to merge 2 commits into
Open
NoelStephensUnity wants to merge 2 commits into
NoelStephensUnity wants to merge 2 commits into
Conversation
RandGenBytes<bool> filled each bool with a random byte, so most values were neither 0 nor 1. On mac arm64 IL2CPP the List<bool> and NativeHashMap<K, bool> cases then failed with both sides printing identical all-True contents. RandGenBool returns only false or true.
| else if (testType == typeof(bool)) | ||
| { | ||
| (var original, var original2, var changed, var changed2) = GetLists(RandGenBytes<bool>); | ||
| (var original, var original2, var changed, var changed2) = GetLists(RandGenBool); |
Contributor
There was a problem hiding this comment.
The boolean list tests can now fail intermittently even when serialization is correct. GetLists allows changed2Adds == 0 and overwrites randomly selected positions with freshly generated booleans. Those overwrites can all preserve the existing values, leaving original2 and changed2 equal. TestList then unconditionally calls AssertListsDoNotMatch after assigning changedValue. GetNativeLists and TestValueTypeNativeList have the same issue. Guarantee that the final changed2 differs from original2 in both list generators.
🤖 Helpful? 👍/👎
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## develop-3.x.x #4198 +/- ##
==============================================
Coverage 76.03% 76.03%
==============================================
Files 159 159
Lines 27344 27344
==============================================
Hits 20791 20791
Misses 6553 6553
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This branch has not been deployed
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.
Purpose of this PR
Fixes 4
NetworkVariableTestsfailures on the mac arm64 IL2CPP nightly, whereList<bool>andNativeHashMap<K, bool>comparisons fail even though both sides print identical contents.RandGenBytes<bool>filled each bool with a random byte, so most values were neither 0 nor 1. Those printTruebut can compare unequal under IL2CPP on ARM64. The newRandGenBoolreturns onlyfalseortrue, and replaces everyRandGenBytes<bool>call site plus theNativeArray<bool>lambda from #4194, so all bool cases share one generator.Jira ticket
None.
Documentation
Testing & QA (How your changes can be verified during release Playtest)
Functional Testing
Automated tests:
Covered by existing automated testsTest-only change; the mac arm64 IL2CPP nightly is the confirming run.
Up-port
Not needed; this targets develop-3.x.x.
Backports
develop-2.0.0 uses the same generator (13 call sites); a separate PR if it shows the same failure there.