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

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


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

commit b737d27c192ed808aa7b9a443949920807f747e1
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 b1ab8d6..f71367f 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;
 
@@ -170,18 +170,18 @@ public class TestSendFile extends TomcatBaseTest {
                 + "=true", bc, null);
 
         CountDownLatch latch = new CountDownLatch(2);
-        List<Throwable> exceptions = new ArrayList<>();
+        List<Throwable> throwables = new CopyOnWriteArrayList<>();
         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