ivankelly commented on a change in pull request #1137: Fix test regression due 
to change in default ledger manager
URL: https://github.com/apache/bookkeeper/pull/1137#discussion_r167585653
 
 

 ##########
 File path: 
bookkeeper-benchmark/src/test/java/org/apache/bookkeeper/benchmark/TestBenchmark.java
 ##########
 @@ -66,27 +81,20 @@ public void testBookie() throws Exception {
 
     @Test
     public void testReadThroughputLatency() throws Exception {
-        final AtomicBoolean threwException = new AtomicBoolean(false);
-        Thread t = new Thread() {
-                public void run() {
-                    try {
-                        BenchReadThroughputLatency.main(new String[] {
-                                "--zookeeper", 
zkUtil.getZooKeeperConnectString(),
-                                "--listen", "10"});
-                    } catch (Throwable t) {
-                        LOG.error("Error reading", t);
-                        threwException.set(true);
-                    }
-                }
-            };
-        t.start();
+        ExecutorService executor = Executors.newSingleThreadExecutor(
+                new 
ThreadFactoryBuilder().setNameFormat("read-throughput-latency-test").build());
+        Future<Integer> f = executor.submit(() -> {
+                BenchReadThroughputLatency.main(new String[] {
+                        "--zookeeper", zkUtil.getZooKeeperConnectString(),
+                        "--listen", "10"});
+                return 0;
+            });
 
-        Thread.sleep(10000);
+        Thread.sleep(2000);
 
 Review comment:
   The refactor reduces the time we spend waiting. Will remove it though.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to