Fix Single Threaded Client Usage Issues in Parallel ACL SETUSER Tests #1064
+12
−19
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.
Summary
The
ParallelTests#ParallelAclSetUserTest
andParallelTests#ParallelAclSetUserAvoidsMapContentionTest
have issues surrounding the client selected for the test and how the client is used within the test. This misuse can lead to sporadic thread safety and memory access violation issues when executing tests.ParallelAclSetUserTest
The
ParallelAclSetUserTest
uses the single threadedGarnetClientSession
, however it launches concurrent tasks usingTask.WhenAll
. This violates the contract of the single threaded client causing sporadic issues with the test. To fix this problem unnecessary usage ofTask.WhenAll
was removed and each individual async command executed by the client was awaited.ParallelAclSetUserAvoidsMapContentionTest
The
ParallelAclSetUserAvoidsMapContentionTest
uses the single threadedGarnetClientSession
to start many tasks concurrently usingTask.WhenAll
. The goal is to create a close race between the first successful task and the runner up, causing contention on the ACL map. However, it launches the concurrent tasks usingTask.WhenAll
, violating the contract of the ingle threaded client. To fix this problem, the test was updated to use theGarnetClient
, which has support for multiple threads.