apisix-dashboard icon indicating copy to clipboard operation
apisix-dashboard copied to clipboard

test: route_with_limit_plugin_test (E2E) may fail

Open idbeta opened this issue 6 years ago • 2 comments

Bug report

when I execute tests in my local environment,somtimes may fail.

How to Reproduce

=== RUN   TestRoute_With_Limit_Plugin_By_Consumer
    printer.go:54: GET http://127.0.0.1:9080/hello
    printer.go:54: PUT http://127.0.0.1:9000/apisix/admin/routes/r1
    printer.go:54: GET http://127.0.0.1:9000/apisix/admin/consumers/jack
    printer.go:54: PUT http://127.0.0.1:9000/apisix/admin/consumers
    printer.go:54: PUT http://127.0.0.1:9000/apisix/admin/consumers
    printer.go:54: GET http://127.0.0.1:9080/hello
    printer.go:54: GET http://127.0.0.1:9080/hello
    printer.go:54: GET http://127.0.0.1:9080/hello
    reporter.go:23:
        	Error Trace:	reporter.go:23
        	            				chain.go:21
        	            				response.go:585
        	            				response.go:151
        	            				base.go:184
        	            				route_with_limit_plugin_test.go:302
        	Error:
        	            	expected status equal to:
        	            	 "503 Service Unavailable"

        	            	but got:
        	            	 "200 OK"
        	Test:       	TestRoute_With_Limit_Plugin_By_Consumer

Additional context

"limit-count": {
     "count": 2,
     "time_window": 2,
     "key": "consumer_name"
}

In this case, the time_window of the limit-count is 2, it should be set larger so that it can avoid the failure.

idbeta avatar Dec 02 '20 09:12 idbeta

"time_window": 2, to "time_window": 60,, should be enough

membphis avatar Dec 02 '20 09:12 membphis

we don't have this fail now, should have be fixed by #976

nic-chen avatar Dec 10 '20 13:12 nic-chen