This is an automated email from the ASF dual-hosted git repository.

albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new e226823  Opt ThreadNameTest check (#7905)
e226823 is described below

commit e2268238b4190feb287af4d22f9fd2efac5b510f
Author: Albumen Kevin <[email protected]>
AuthorDate: Sat May 29 17:20:26 2021 +0800

    Opt ThreadNameTest check (#7905)
---
 .../org/apache/dubbo/remoting/transport/netty/ThreadNameTest.java    | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/dubbo-remoting/dubbo-remoting-netty/src/test/java/org/apache/dubbo/remoting/transport/netty/ThreadNameTest.java
 
b/dubbo-remoting/dubbo-remoting-netty/src/test/java/org/apache/dubbo/remoting/transport/netty/ThreadNameTest.java
index 77d833d..bdb70d0 100644
--- 
a/dubbo-remoting/dubbo-remoting-netty/src/test/java/org/apache/dubbo/remoting/transport/netty/ThreadNameTest.java
+++ 
b/dubbo-remoting/dubbo-remoting-netty/src/test/java/org/apache/dubbo/remoting/transport/netty/ThreadNameTest.java
@@ -106,6 +106,9 @@ public class ThreadNameTest {
             if (!success) {
                 success = Thread.currentThread().getName().matches(message);
             }
+            if (success) {
+                latch.countDown();
+            }
         }
 
         private void output(String method) {
@@ -129,14 +132,12 @@ public class ThreadNameTest {
         public void sent(Channel channel, Object message) throws 
RemotingException {
             output("sent");
             checkThreadName();
-            latch.countDown();
         }
 
         @Override
         public void received(Channel channel, Object message) throws 
RemotingException {
             output("received");
             checkThreadName();
-            latch.countDown();
         }
 
         @Override

Reply via email to