Fix chashsubset backend with canary (#7235)
* Fix chashsubset backend with canary * use floor for buckets calculation to remove hot spot * Remove testing code
This commit is contained in:
parent
a14edba8d5
commit
e625c2507a
2 changed files with 19 additions and 2 deletions
|
|
@ -86,5 +86,21 @@ describe("Balancer chash subset", function()
|
|||
assert.are.equal(#endpoints, 3)
|
||||
end
|
||||
end)
|
||||
|
||||
it("set alternative backends", function()
|
||||
local backend = get_test_backend(7)
|
||||
backend.trafficShapingPolicy = {
|
||||
weight = 0,
|
||||
header = "",
|
||||
headerValue = "",
|
||||
cookie = ""
|
||||
}
|
||||
backend.alternativeBackends = {
|
||||
"my-dummy-canary-backend"
|
||||
}
|
||||
local instance = balancer_chashsubset:new(backend)
|
||||
assert.not_equal(instance.traffic_shaping_policy, nil)
|
||||
assert.not_equal(instance.alternative_backends, nil)
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue