Handle slicer Toxic with zero SizeVariation#359
Conversation
|
Removed the use of labels in the tests, also reduced the waiting time for timeout so the tests wait less long to complete. (But much more time than the delay so it won't time out unexpectedly.) |
|
@areveny It looks like I still have problems random failing tests for Slicer. $ MallocNanoZone=0 go test -v -race -timeout 1m ./...
...
=== RUN TestSlicerToxic
slicer_test.go:53: Expected to read about 480 times, but read 0 times.
slicer_test.go:56: Server did not read correct buffer from client!
--- FAIL: TestSlicerToxic (0.02s) |
5d9e748 to
52578a7
Compare
|
Reverted the timeout to its original duration. |
|
Thank you @areveny. Can you please update the title of the current PR and entry in CHANGELOG to make it more informative. Example: Handle toxic slicer when SizeVariation is null. |
|
Great. All feedback so far has been incorporated. |
Strech
left a comment
There was a problem hiding this comment.
LGTM 👍🏼
I would suggest to take a look at the comment which might be outdated
|
@areveny Propose to change the code a bit. Moved the +{0,1} to default, according the comment it was connected to part |
|
I have gone with the approach of removing the |
|
Changes have been release as part of https://github.com/Shopify/toxiproxy/releases/tag/v2.4.0 |
This change skips randomized size variation for the slicer toxic if the
SizeVariationparameter is 0, which is also the default setting.Additionally, it fixes a small bug in the randomization.
rand.Intn(1)was being added tomidto adjust for integer division rounding. However,rand.Intn(n)returns an integer in the range [0, n), sorand.Intn(1)always returns 0. It has been changed torand.Intn(2).Closes #178