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:
Wei Wu 2021-12-29 16:14:50 -08:00 committed by GitHub
parent a14edba8d5
commit e625c2507a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 2 deletions

View file

@ -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)