sshniro edited a comment on issue #1189: request help: How to implement thread 
sleep in Nginx Test
URL: 
https://github.com/apache/incubator-apisix/issues/1189#issuecomment-594379479
 
 
   I would like to write a test case to test the inactive timeout. The 
following are the configurations.
   - Inactive Timeout = 2 S
   - Batch Max Size = 100
   
   
![image](https://user-images.githubusercontent.com/13045528/75857387-72f1ab00-5df6-11ea-9a34-93cfb62db54c.png)
   
   I would like to push an entry to the buffer at 0s and wait till 2s and push 
another entry. In this manner, I can reach the last segment of the code 
block[extending buffer timer]. To achieve this I need to wait for 2s before 
pushing the next entry to the buffer in the test case.
   
   I've tried this solution but unfortunately, it does not work as expected.
   ```lua
   require "socket"
   
   function sleep(sec)
       socket.select(nil, nil, sec)
   end
   
   sleep(2)
   ```
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to