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


##########
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));
         }
         catch (Throwable thrown)
         {
             Throwable cause = thrown;
             if (cause instanceof ExecutionException)
                 cause = cause.getCause();
-            if (cause instanceof InterruptedException || cause instanceof 
TimeoutException)
-                t.interrupt();
             if (cause instanceof TimeoutException)
             {
                 TimeoutException override = new TimeoutException("test did not 
complete within " + timeout);
                 override.setStackTrace(new StackTraceElement[0]);
                 cause = override;
             }
-            logger.error("Exception running burn test for seed {}:", seed, t);
+            logger.error("Exception running burn test for seed {}:", seed, 
cause);

Review Comment:
   `t` was a bug, ment to do `cause` or `thrown` to see what actually caused 
the failure



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