jhuan31 commented on a change in pull request #1116: ZOOKEEPER-3575: Moving 
sending packets in Learner to a separate thread
URL: https://github.com/apache/zookeeper/pull/1116#discussion_r356942795
 
 

 ##########
 File path: 
zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/LearnerMetricsTest.java
 ##########
 @@ -32,16 +34,30 @@
 import org.hamcrest.Matcher;
 import org.junit.After;
 import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
 
+@RunWith(Parameterized.class)
 public class LearnerMetricsTest extends QuorumPeerTestBase {
 
     private static final int TIMEOUT_SECONDS = 30;
     private static final int SERVER_COUNT = 4; // 1 observer, 3 participants
     private final QuorumPeerTestBase.MainThread[] mt = new 
QuorumPeerTestBase.MainThread[SERVER_COUNT];
     private ZooKeeper zk_client;
+    private boolean asyncSending;
+
+    public LearnerMetricsTest(boolean asyncSending) {
+        this.asyncSending = asyncSending;
+    }
+
+    @Parameterized.Parameters
+    public static Collection sendingModes() {
+        return Arrays.asList(new Object[][]{{true}, {false}});
+    }
 
     @Test
     public void testLearnerMetricsTest() throws Exception {
+        Learner.setAsyncSending(asyncSending);
 
 Review comment:
   I assume you mean "reset in @after?"

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