ctubbsii commented on code in PR #5853:
URL: https://github.com/apache/accumulo/pull/5853#discussion_r2342426339


##########
core/src/test/java/org/apache/accumulo/core/file/rfile/bcfile/CompressionTest.java:
##########
@@ -192,12 +192,14 @@ public void testManyStartNotNull() throws 
InterruptedException, ExecutionExcepti
         ExecutorService service = Executors.newFixedThreadPool(numTasks);
 
         ArrayList<Future<Boolean>> results = new ArrayList<>(numTasks);
-        CountDownLatch startSignal = new CountDownLatch(numTasks);
+        CountDownLatch startLatch = new CountDownLatch(numTasks);

Review Comment:
   Why rename it here, but not below?



##########
test/src/main/java/org/apache/accumulo/test/UniqueNameAllocatorIT.java:
##########
@@ -71,6 +71,8 @@ void testConcurrentNameGeneration() throws Exception {
     List<Future<Integer>> futures = new ArrayList<>();
     // start a portion of threads at the same time
     CountDownLatch startLatch = new CountDownLatch(32);
+    assertTrue(64 >= startLatch.getCount(),
+        "Not enough tasks to satisfy latch count - deadlock risk");
 
     // create threads that are allocating large random chunks
     for (int i = 0; i < 64; i++) {

Review Comment:
   In the assertion, need to check the actual number of threads used in the 
loop, rather than a literal that can diverge from the literal used in the loop. 
Can do this by coupling them together with a variable.
   
   ```suggestion
       int numThreads = 64;
       assertTrue(numThreads >= startLatch.getCount(),
           "Not enough tasks to satisfy latch count - deadlock risk");
   
       // create threads that are allocating large random chunks
       for (int i = 0; i < numThreads; i++) {
   ```



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

Reply via email to