apisix icon indicating copy to clipboard operation
apisix copied to clipboard

test: some test cases of chash-balance.t are unreasonable

Open idbeta opened this issue 6 years ago • 1 comments

Issue description

some test cases of chash-balance.t are unreasonable.

Environment

  • apisix version (cmd: apisix version): master
  • OS:

Minimal test code / Steps to reproduce the issue

https://github.com/apache/apisix/blob/master/t/node/chash-balance.t === TEST 4: hit routes When the upstream weights are all the same, the test result should not be hard-coded as [{"count":12,"port":"1982"}]

=== TEST 8: hit routes with querystring When the upstream weights are all the same, the test result should not be hard-coded as [{"count":5,"port":"1982"},{"count":8,"port":"1981"},{"count":5,"port":"1980"}]

=== TEST 10: hit routes with args When the upstream weights are all the same, the test result should not be hard-coded as [{"count":5,"port":"1982"},{"count":7,"port":"1981"},{"count":6,"port":"1980"}]

idbeta avatar Dec 01 '20 15:12 idbeta

For different upstreams, the weights are all 1. The best result for different keys is that client requests are evenly distributed in a ratio of 1:1:1. The number of request tests for the current case is not enough.

idbeta avatar Dec 02 '20 02:12 idbeta