janiussyafiq commented on code in PR #13019:
URL: https://github.com/apache/apisix/pull/13019#discussion_r2850589442


##########
t/plugin/limit-req.t:
##########
@@ -452,7 +452,7 @@ passed
 --- more_headers
 apikey: auth-jack
 --- error_code eval
-[403, 403, 403, 403]
+[200, 403, 403, 403]

Review Comment:
   That is indeed the case and I even double check it manually to confirm that 
the key gets updated after we updated the `limit-req` config,
   ```
   2026/02/25 02:19:48 [error] 98621#98621: *3824971 [lua] limit-req.lua:161: 
phase_func(): limit key: jackroute&consumer6896&1, client: 127.0.0.1, server: 
_, request: "GET /get HTTP/1.1", host: "127.0.0.1:9080", request_id: 
"b7365540e7c2ea83e69ddbfc56d1dcb9"
   2026/02/25 02:30:16 [error] 98622#98622: *3876200 [lua] limit-req.lua:161: 
phase_func(): limit key: jackroute&consumer6896&2, client: 127.0.0.1, server: 
_, request: "GET /get HTTP/1.1", host: "127.0.0.1:9080", request_id: 
"a01763218daf2f8e4911c208a2da8b8d"
   ```
   but upon running the test, I can confirm that the key indeed persisted even 
after plugin update (see limit key):
   ```
   #   Failed test 't/plugin/limit-req.t TEST 14: not exceeding the burst - 
pattern "[error]" should not match any line in error.log but matches line 
"2026/02/25 02:48:48 [error] 12944#12944: *1217 [lua] limit-req.lua:161: 
phase_func(): limit key: new_consumerroute&consumer7060&1, client: 127.0.0.1, 
server: localhost, request: \"GET /hello HTTP/1.1\", host: \"localhost\", 
request_id: \"55af5f6e801120afb962f643141ae8b1\"" (req 0)
   #   Failed test 't/plugin/limit-req.t TEST 16: exceeding the burst - pattern 
"[error]" should not match any line in error.log but matches line "2026/02/25 
02:48:51 [error] 13097#13097: *1405 [lua] limit-req.lua:161: phase_func(): 
limit key: new_consumerroute&consumer7060&1, client: 127.0.0.1, server: 
localhost, request: \"GET /hello HTTP/1.1\", host: \"localhost\", request_id: 
\"a6bb80f372f3f39eb8f792296c485198\"" (req 0)
   ```
   this is an unexpected behavior and i am currently not sure what causing it. 
One of the function mentioned upon running this test is `merge_consumer_route`; 
maybe it originated from there (?).
   i tried changing the `key` value and the test is still passing i.e. key 
persisted. however when i change the `username` within consumer config, the 
first request is now passing. I think this is important to take note on.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to