You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/12/08 10:21:08 UTC

[GitHub] [apisix] spacewander commented on a change in pull request #2980: fix: we should use [1, 100] for percentage instead of [0, 100]

spacewander commented on a change in pull request #2980:
URL: https://github.com/apache/apisix/pull/2980#discussion_r538213374



##########
File path: apisix/plugins/fault-injection.lua
##########
@@ -60,7 +60,7 @@ local function sample_hit(percentage)
         return true
     end
 
-    return random(0, 100) <= percentage
+    return random(1, 100) <= percentage

Review comment:
       Current behavior is the correct one according to the doc. Previously, fault-injection will happen even percentage is zero.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org