dcapwell commented on code in PR #103:
URL: https://github.com/apache/cassandra-accord/pull/103#discussion_r1674889702


##########
accord-core/src/test/java/accord/burn/BurnTest.java:
##########
@@ -551,40 +549,22 @@ public void testOne()
     private static void run(long seed)
     {
         Duration timeout = Duration.ofMinutes(3);
-        Runnable fn = () -> run(seed, 1000);
-        AsyncResult.Settable<?> promise = AsyncResults.settable();
-        Thread t = new Thread(() -> {
-            try
-            {
-                fn.run();
-                promise.setSuccess(null);
-            }
-            catch (Throwable e)
-            {
-                promise.setFailure(e);
-            }
-        });
-        t.setName("BurnTest with timeout");
-        t.setDaemon(true);
         try
         {
-            t.start();
-            AsyncChains.getBlocking(promise, timeout.toNanos(), 
TimeUnit.NANOSECONDS);
+            TimeoutUtils.runBlocking(timeout, "BurnTest with timeout", () -> 
run(seed, 1000));

Review Comment:
   removing duplicate logic...  This logic was forked from property testing, 
and now that its a utility I just leverage that rather than fork the logic 
still.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to