This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/7.0.x by this push:
     new 991e357  Thread safety. Better variable names. Clear failure message.
991e357 is described below

commit 991e3576f94b93e945d0eebaf6d6903c5ed733d2
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Aug 19 16:47:56 2020 +0100

    Thread safety. Better variable names. Clear failure message.
---
 test/org/apache/catalina/connector/TestSendFile.java | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/test/org/apache/catalina/connector/TestSendFile.java 
b/test/org/apache/catalina/connector/TestSendFile.java
index f525b39..a4003cb 100644
--- a/test/org/apache/catalina/connector/TestSendFile.java
+++ b/test/org/apache/catalina/connector/TestSendFile.java
@@ -22,12 +22,12 @@ import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileWriter;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Random;
+import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
@@ -187,18 +187,18 @@ public class TestSendFile extends TomcatBaseTest {
                 + "=true", bc, null);
 
         CountDownLatch latch = new CountDownLatch(2);
-        List<Throwable> exceptions = new ArrayList<Throwable>();
+        List<Throwable> throwables = new CopyOnWriteArrayList<Throwable>();
         new Thread(
-                new RequestExecutor("http://localhost:"; + getPort() + 
"/test/", latch, exceptions))
+                new RequestExecutor("http://localhost:"; + getPort() + 
"/test/", latch, throwables))
                         .start();
         new Thread(
-                new RequestExecutor("http://localhost:"; + getPort() + 
"/test/", latch, exceptions))
+                new RequestExecutor("http://localhost:"; + getPort() + 
"/test/", latch, throwables))
                         .start();
 
         latch.await(3000, TimeUnit.MILLISECONDS);
 
-        if (exceptions.size() > 0) {
-            Assert.fail();
+        if (throwables.size() > 0) {
+            Assert.fail("[" + throwables.size() + "] throwables observed");
         }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to