test: update rpc queue unit tests - #626
Merged
Merged
Conversation
This removes the NetworkManager.Singleton dependencies from within the RpcQueueContainer and RpcQueueProcessor classes. This further strengthens the RPC Queue system as a whole, will allow for multiple instances if RpcQueueContainer, removes a limitation I set in NetworkWriter.ReadAndWrite, and provides unit testing capabilities required for new RPC Queue unit Tests.
The new rpc queue tests without all of the extra files associated with them.
This is the merging artifact I had follow me through the branches.
This fix was inspired by Beck mentioning that the StartNetworkManager didn't have a comment that it could only start in Host mode. I added some additional parameters to allow one to start the NetworkManager in Host, Server, or Client mode.
0xFA11
reviewed
Mar 16, 2021
nice find! Co-authored-by: M. Fatih MAR <[email protected]>
0xFA11
reviewed
Mar 16, 2021
0xFA11
reviewed
Mar 16, 2021
Renaming m_CurrentNetworkManagerMode to s_CurrentNetworkManagerMode
0xFA11
reviewed
Mar 16, 2021
0xFA11
reviewed
Mar 16, 2021
0xFA11
reviewed
Mar 16, 2021
0xFA11
reviewed
Mar 16, 2021
0xFA11
reviewed
Mar 16, 2021
0xFA11
reviewed
Mar 16, 2021
0xFA11
reviewed
Mar 16, 2021
0xFA11
reviewed
Mar 16, 2021
0xFA11
suggested changes
Mar 16, 2021
0xFA11
left a comment
Contributor
There was a problem hiding this comment.
I believe changes in RpcQueueHistoryFrame and the new NetworkManagerHelper should go under 2 separate, isolated, bite-sized PRs and then we should have this going into develop.
Ahhh yeah... nicely found! Co-authored-by: M. Fatih MAR <[email protected]>
…nologies/com.unity.multiplayer.mlapi into test/newrpcqueuetests
Yes, that I do! Co-authored-by: M. Fatih MAR <[email protected]>
Dropped a t in networkManagerComponent. Added the t back.
…nologies/com.unity.multiplayer.mlapi into test/newrpcqueuetests
A slicker version of my logging done in one pass (thanks to Fatih for the suggestion)!
0xFA11
reviewed
Mar 16, 2021
0xFA11
reviewed
Mar 16, 2021
0xFA11
reviewed
Mar 17, 2021
0xFA11
approved these changes
Mar 17, 2021
0xFA11
left a comment
Contributor
There was a problem hiding this comment.
🚀 (with some minor edit suggestions)
Another nice suggestion! Co-authored-by: M. Fatih MAR <[email protected]>
Co-authored-by: M. Fatih MAR <[email protected]>
Co-authored-by: M. Fatih MAR <[email protected]>
Fixed the scenario where it would log that "None" stopped.
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.
This update to the RpcQueueTests provides the following functionality:
Improved names to better convey what aspect of the RpcQueue is being tested.
This includes a most likely undetected bug that would limit the maximum size that could be copied to 128kb within the NetworkWriter.ReadAndWrite method (primarily used by the RpcQueueHistoryFrame. NetworkWriter.ReadAndWrite now has no limits on the size.
Minor Adjustments to RpcQueueHistoryFrame:
Allowing the maximum Rpc Queue Message size to be adjustable. Currently it defaults to 1MB.
NetworkUpdateStagesComponent:
Used in conjunction with the RpcQueueTest to validate that Rpcs are being invoked at the proper NetworkUpdateStage
BufferDataValidationComponent:
Used in conjunction with the RpcQueueTest to validate from 1 byte to (n) MaximumBufferSize
The RpcQueue unit tests validate:
Maximum buffer size that can be sent from 1 byte up to 1MB (the default maximum RpcQueueHistoryFrame size)
That all RPCs invoke at the appropriate NetworkUpdateStage (Client and Server)
A lower level RpcQueueContainer test that validates RpcQueueFrameItems after they have been put into the queue
NetworkManagerHelper:
A nifty tool that now lives in the MLAPI.RuntimeTests namespace.
This makes writing MLAPI unit tests simpler while also making sure that if you fail it will clean up after itself.
Simplifies creating NetworkObjects and adding any unique testing component that are automatically cleaned at the end of the test(s). This includes a BuffersMatch helper method that will verify two buffers are the same!