<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.4.1</li>
<li>Operating System version: MacBook Pro</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>telnet</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="➜  ~ telnet 127.0.0.1 20880
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
dubbo&gt;"><pre class="notranslate"><code class="notranslate">➜  ~ telnet 127.0.0.1 20880
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
dubbo&gt;
</code></pre></div>
<ol start="2" dir="auto">
<li>invoke</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dubbo&gt;invoke org.apache.dubbo.demo.DemoService.sayHello(&quot;lios&quot;)
Unsupported command: invoke"><pre class="notranslate"><code class="notranslate">dubbo&gt;invoke org.apache.dubbo.demo.DemoService.sayHello("lios")
Unsupported command: invoke
</code></pre></div>
<ol start="3" dir="auto">
<li>help</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="dubbo&gt;help
Please input &quot;help [command]&quot; show detail.
 status [-l]    - Show status.
 clear [lines]  - Clear screen.
 log level      - Change log level or show log 
 help [command] - Show help.
 exit           - Exit the telnet.
dubbo&gt;"><pre class="notranslate"><code class="notranslate">dubbo&gt;help
Please input "help [command]" show detail.
 status [-l]    - Show status.
 clear [lines]  - Clear screen.
 log level      - Change log level or show log 
 help [command] - Show help.
 exit           - Exit the telnet.
dubbo&gt;
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.1</li>
<li>Operating System version: MacOS Mojave</li>
<li>Java version: 8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@Test
public void testAccuracy() throws Exception {
	statItem = new StatItem(&quot;test&quot;, 5, 60_000L);
	assertEquals(true, statItem.isAllowable());
	assertEquals(true, statItem.isAllowable());
	assertEquals(true, statItem.isAllowable());
	assertEquals(true, statItem.isAllowable());
	assertEquals(true, statItem.isAllowable());
	//Must block the 6th item
	assertEquals(false, statItem.isAllowable());
}"><pre class="notranslate"><code class="notranslate">@Test
public void testAccuracy() throws Exception {
	statItem = new StatItem("test", 5, 60_000L);
	assertEquals(true, statItem.isAllowable());
	assertEquals(true, statItem.isAllowable());
	assertEquals(true, statItem.isAllowable());
	assertEquals(true, statItem.isAllowable());
	assertEquals(true, statItem.isAllowable());
	//Must block the 6th item
	assertEquals(false, statItem.isAllowable());
}
</code></pre></div>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">The last assertEquals should  pass. Because according to the JavaDoc of TPSLimiter<br>
<code class="notranslate"> if tps for a method m1 is 5 for a minute then if 6th call is made within the span of 1 minute then 6th should not be allowed isAllowable will return false.</code></p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">The last assertEquals failed, because <code class="notranslate">statItem.isAllowable()</code> lets 1 more request pass for a period.</p>